diff options
author | Matthew Hoops | 2010-05-20 18:38:06 +0000 |
---|---|---|
committer | Matthew Hoops | 2010-05-20 18:38:06 +0000 |
commit | 2e0fdda51ff9ff48bb8cbfcc770f9fd99cccd43e (patch) | |
tree | 415ceedd9e1e46b743edc1155549252ef1773b61 /engines/mohawk/video/qt_player.cpp | |
parent | f76f64774aa5c7d9669196c0258767d1e9f43cfb (diff) | |
download | scummvm-rg350-2e0fdda51ff9ff48bb8cbfcc770f9fd99cccd43e.tar.gz scummvm-rg350-2e0fdda51ff9ff48bb8cbfcc770f9fd99cccd43e.tar.bz2 scummvm-rg350-2e0fdda51ff9ff48bb8cbfcc770f9fd99cccd43e.zip |
Add a pause level system to VideoDecoder (blatantly ripped off from Engine) and adapt Mohawk to it.
svn-id: r49120
Diffstat (limited to 'engines/mohawk/video/qt_player.cpp')
-rw-r--r-- | engines/mohawk/video/qt_player.cpp | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/engines/mohawk/video/qt_player.cpp b/engines/mohawk/video/qt_player.cpp index b19343005e..28ddc446e9 100644 --- a/engines/mohawk/video/qt_player.cpp +++ b/engines/mohawk/video/qt_player.cpp @@ -187,23 +187,20 @@ Graphics::Codec *QTPlayer::createCodec(uint32 codecTag, byte bitsPerPixel) { } void QTPlayer::startAudio() { - if (!_audStream) // No audio/audio not supported - return; - - g_system->getMixer()->playStream(Audio::Mixer::kPlainSoundType, &_audHandle, _audStream); + if (_audStream) // No audio/audio not supported + g_system->getMixer()->playStream(Audio::Mixer::kPlainSoundType, &_audHandle, _audStream); } -void QTPlayer::pauseAudio() { - g_system->getMixer()->pauseHandle(_audHandle, true); -} - -void QTPlayer::resumeAudio() { - g_system->getMixer()->pauseHandle(_audHandle, false); +void QTPlayer::stopAudio() { + if (_audStream) { + g_system->getMixer()->stopHandle(_audHandle); + _audStream = NULL; // the mixer automatically frees the stream + } } -void QTPlayer::stopAudio() { - g_system->getMixer()->stopHandle(_audHandle); - _audStream = NULL; // the mixer automatically frees the stream +void QTPlayer::pauseVideoIntern(bool pause) { + if (_audStream) + g_system->getMixer()->pauseHandle(_audHandle, pause); } Graphics::Surface *QTPlayer::decodeNextFrame() { @@ -244,12 +241,6 @@ bool QTPlayer::endOfVideo() const { return (!_audStream || _audStream->endOfData()) && (!_videoCodec || _curFrame >= (int32)getFrameCount() - 1); } -void QTPlayer::addPauseTime(uint32 p) { - Graphics::VideoDecoder::addPauseTime(p); - if (_videoStreamIndex >= 0) - _nextFrameStartTime += p * _streams[_videoStreamIndex]->time_scale / 1000; -} - bool QTPlayer::needsUpdate() const { return !endOfVideo() && getTimeToNextFrame() == 0; } |