From ccd5129588cd78eb4234c8c3d2b2770a5d19cf40 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Sun, 23 Jan 2011 15:33:30 +0000 Subject: GOB: Pass engine pause to the VideoPlayer and decoders Entering the GMM or the debug console during a video will not mess up audio/video sync anymore. svn-id: r55466 --- engines/gob/gob.cpp | 1 + engines/gob/videoplayer.cpp | 13 +++++++++++++ engines/gob/videoplayer.h | 3 +++ 3 files changed, 17 insertions(+) (limited to 'engines') diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp index 8dfbf7df21..f2bec9b0f0 100644 --- a/engines/gob/gob.cpp +++ b/engines/gob/gob.cpp @@ -373,6 +373,7 @@ void GobEngine::pauseEngineIntern(bool pause) { _inter->_soundEndTimeKey += duration; } + _vidPlayer->pauseAll(pause); _mixer->pauseAll(pause); } diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp index f279cb9744..b9eb42a2fe 100644 --- a/engines/gob/videoplayer.cpp +++ b/engines/gob/videoplayer.cpp @@ -238,6 +238,19 @@ void VideoPlayer::closeAll() { closeVideo(i); } +void VideoPlayer::pauseVideo(int slot, bool pause) { + Video *video = getVideoBySlot(slot); + if (!video || !video->decoder) + return; + + video->decoder->pauseVideo(pause); +} + +void VideoPlayer::pauseAll(bool pause) { + for (int i = 0; i < kVideoSlotCount; i++) + pauseVideo(i, pause); +} + bool VideoPlayer::play(int slot, Properties &properties) { Video *video = getVideoBySlot(slot); if (!video) diff --git a/engines/gob/videoplayer.h b/engines/gob/videoplayer.h index bae1fe3702..26c2c32a3c 100644 --- a/engines/gob/videoplayer.h +++ b/engines/gob/videoplayer.h @@ -113,6 +113,9 @@ public: void closeLiveSound(); void closeAll(); + void pauseVideo(int slot, bool pause); + void pauseAll(bool pause); + bool play(int slot, Properties &properties); void waitEndFrame(int slot, bool onlySound = false); -- cgit v1.2.3