aboutsummaryrefslogtreecommitdiff
path: root/graphics/video
diff options
context:
space:
mode:
authorMax Horn2010-01-09 22:37:10 +0000
committerMax Horn2010-01-09 22:37:10 +0000
commita44c6e43233ffd4b89fb6a6a96e156cd43412c3d (patch)
tree4c0ee8aa9344980aca973eb1b18edfaa8350afc5 /graphics/video
parent4a832ceb0179d280a5baca9db462cf9124d088e2 (diff)
downloadscummvm-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.cpp6
-rw-r--r--graphics/video/smk_decoder.cpp6
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;
}