diff options
author | Max Horn | 2010-01-09 22:37:10 +0000 |
---|---|---|
committer | Max Horn | 2010-01-09 22:37:10 +0000 |
commit | a44c6e43233ffd4b89fb6a6a96e156cd43412c3d (patch) | |
tree | 4c0ee8aa9344980aca973eb1b18edfaa8350afc5 /graphics/video | |
parent | 4a832ceb0179d280a5baca9db462cf9124d088e2 (diff) | |
download | scummvm-rg350-a44c6e43233ffd4b89fb6a6a96e156cd43412c3d.tar.gz scummvm-rg350-a44c6e43233ffd4b89fb6a6a96e156cd43412c3d.tar.bz2 scummvm-rg350-a44c6e43233ffd4b89fb6a6a96e156cd43412c3d.zip |
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
Diffstat (limited to 'graphics/video')
-rw-r--r-- | graphics/video/avi_decoder.cpp | 6 | ||||
-rw-r--r-- | graphics/video/smk_decoder.cpp | 6 |
2 files changed, 8 insertions, 4 deletions
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; } |