From 50c7a8f9971388bdb845f3518618fad9ab9a4023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Mon, 2 Jun 2008 18:21:55 +0000 Subject: [PATCH] Small code cleanups. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25763 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../media_node_framework/PlaybackManager.cpp | 10 ++++++---- .../media_node_framework/audio/AudioProducer.cpp | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/apps/mediaplayer/media_node_framework/PlaybackManager.cpp b/src/apps/mediaplayer/media_node_framework/PlaybackManager.cpp index d425850fa9..135d08917d 100644 --- a/src/apps/mediaplayer/media_node_framework/PlaybackManager.cpp +++ b/src/apps/mediaplayer/media_node_framework/PlaybackManager.cpp @@ -713,10 +713,12 @@ PlaybackManager::GetPlaylistTimeInterval(bigtime_t startTime, int64 xEndFrame; int32 playingDirection; GetPlaylistFrameInterval(startFrame, endFrame, xStartFrame, xEndFrame, - playingDirection); + playingDirection); // 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; + // Finally determine the time bounds for the Playlist interval (depending // on the playing direction). switch (playingDirection) { @@ -780,8 +782,8 @@ if (!info) { return 0; } int64 frame = (int64)(((double)time - info->activation_time) - * (double)fFrameRate * info->speed / 1000000.0) - + info->activation_frame; + * (double)fFrameRate * info->speed / 1000000.0) + + info->activation_frame; if (TimeForFrame(frame) > time) frame--; else if (TimeForFrame(frame + 1) <= time) diff --git a/src/apps/mediaplayer/media_node_framework/audio/AudioProducer.cpp b/src/apps/mediaplayer/media_node_framework/audio/AudioProducer.cpp index f203fd632b..e8f24dec41 100644 --- a/src/apps/mediaplayer/media_node_framework/audio/AudioProducer.cpp +++ b/src/apps/mediaplayer/media_node_framework/audio/AudioProducer.cpp @@ -711,10 +711,10 @@ AudioProducer::_FillNextBuffer(bigtime_t eventTime) * 1000000.0 / double(fOutput.format.u.raw_audio.frame_rate)); // 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 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 || fSupplier->GetFrames(buffer->Data(), frameCount, startTime,