Small code cleanups.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25763 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2008-06-02 18:21:55 +00:00
parent 3dd59121c4
commit 50c7a8f997
2 changed files with 8 additions and 6 deletions
@@ -713,10 +713,12 @@ PlaybackManager::GetPlaylistTimeInterval(bigtime_t startTime,
int64 xEndFrame; int64 xEndFrame;
int32 playingDirection; int32 playingDirection;
GetPlaylistFrameInterval(startFrame, endFrame, xStartFrame, xEndFrame, GetPlaylistFrameInterval(startFrame, endFrame, xStartFrame, xEndFrame,
playingDirection); playingDirection);
// Calculate the performance time interval end/length. // Calculate the performance time interval end/length.
endTime = min(endTime, TimeForFrame(endFrame)); bigtime_t endTimeForFrame = TimeForFrame(endFrame);
endTime = min(endTime, endTimeForFrame);
bigtime_t intervalLength = endTime - startTime; bigtime_t intervalLength = endTime - startTime;
// Finally determine the time bounds for the Playlist interval (depending // Finally determine the time bounds for the Playlist interval (depending
// on the playing direction). // on the playing direction).
switch (playingDirection) { switch (playingDirection) {
@@ -780,8 +782,8 @@ if (!info) {
return 0; return 0;
} }
int64 frame = (int64)(((double)time - info->activation_time) int64 frame = (int64)(((double)time - info->activation_time)
* (double)fFrameRate * info->speed / 1000000.0) * (double)fFrameRate * info->speed / 1000000.0)
+ info->activation_frame; + info->activation_frame;
if (TimeForFrame(frame) > time) if (TimeForFrame(frame) > time)
frame--; frame--;
else if (TimeForFrame(frame + 1) <= time) else if (TimeForFrame(frame + 1) <= time)
@@ -711,10 +711,10 @@ AudioProducer::_FillNextBuffer(bigtime_t eventTime)
* 1000000.0 / double(fOutput.format.u.raw_audio.frame_rate)); * 1000000.0 / double(fOutput.format.u.raw_audio.frame_rate));
// fill in data from audio supplier // fill in data from audio supplier
size_t frameCount = numSamples / fOutput.format.u.raw_audio.channel_count; int64 frameCount = numSamples / fOutput.format.u.raw_audio.channel_count;
bigtime_t startTime = performanceTime; bigtime_t startTime = performanceTime;
bigtime_t endTime = bigtime_t(double(fFramesSent + frameCount) bigtime_t endTime = bigtime_t(double(fFramesSent + frameCount)
* 1000000.0 / double(fOutput.format.u.raw_audio.frame_rate)); * 1000000.0 / fOutput.format.u.raw_audio.frame_rate);
if (!fSupplier || fSupplier->InitCheck() != B_OK if (!fSupplier || fSupplier->InitCheck() != B_OK
|| fSupplier->GetFrames(buffer->Data(), frameCount, startTime, || fSupplier->GetFrames(buffer->Data(), frameCount, startTime,