From a44c6e43233ffd4b89fb6a6a96e156cd43412c3d Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 9 Jan 2010 22:37:10 +0000 Subject: Add Mixer::getElapsedTime() method returning a Timestamp, thus offering a higher precision than Mixer::getSoundElapsedTime(). Convert some video code to use it. svn-id: r47213 --- graphics/video/avi_decoder.cpp | 6 ++++-- graphics/video/smk_decoder.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'graphics/video') diff --git a/graphics/video/avi_decoder.cpp b/graphics/video/avi_decoder.cpp index 7416d86310..f54de46731 100644 --- a/graphics/video/avi_decoder.cpp +++ b/graphics/video/avi_decoder.cpp @@ -412,8 +412,10 @@ int32 AviDecoder::getAudioLag() { */ audioTime = (g_system->getMillis() - _videoInfo.startTime) * 100; - } else - audioTime = (((int32)_mixer->getSoundElapsedTime(*_audHandle)) * 100); + } else { + const Audio::Timestamp ts = _mixer->getElapsedTime(*_audHandle); + audioTime = ts.convertToFramerate(100000).totalNumberOfFrames(); + } return videoTime - audioTime; } diff --git a/graphics/video/smk_decoder.cpp b/graphics/video/smk_decoder.cpp index 1a313b9f2e..a3b056b6a3 100644 --- a/graphics/video/smk_decoder.cpp +++ b/graphics/video/smk_decoder.cpp @@ -377,8 +377,10 @@ int32 SmackerDecoder::getAudioLag() { */ audioTime = (g_system->getMillis() - _videoInfo.startTime) * 100; - } else - audioTime = (((int32) _mixer->getSoundElapsedTime(_audioHandle)) * 100); + } else { + const Audio::Timestamp ts = _mixer->getElapsedTime(_audioHandle); + audioTime = ts.convertToFramerate(100000).totalNumberOfFrames(); + } return videoTime - audioTime; } -- cgit v1.2.3