[Scummvm-cvs-logs] scummvm master -> 9f2c3d794e4594fd736b6130412c1685ea21afc9
bluegr
bluegr at gmail.com
Fri Nov 7 21:14:40 CET 2014
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
9f2c3d794e GROOVIE: Do not play audio in V2 games when only one frame is shown
Commit: 9f2c3d794e4594fd736b6130412c1685ea21afc9
https://github.com/scummvm/scummvm/commit/9f2c3d794e4594fd736b6130412c1685ea21afc9
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-11-07T12:11:33+02:00
Commit Message:
GROOVIE: Do not play audio in V2 games when only one frame is shown
Changed paths:
engines/groovie/roq.cpp
engines/groovie/roq.h
diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp
index 8f272d4..f14cacd 100644
--- a/engines/groovie/roq.cpp
+++ b/engines/groovie/roq.cpp
@@ -174,7 +174,7 @@ bool ROQPlayer::playFrameInternal() {
// Wait until the current frame can be shown
// Don't wait if we're just showing one frame
- if (!(_alpha && !_flagTwo))
+ if (!playFirstFrame())
waitFrame();
if (_dirty) {
@@ -193,7 +193,7 @@ bool ROQPlayer::playFrameInternal() {
// Report the end of the video if we reached the end of the file or if we
// just wanted to play one frame.
- return _file->eos() || (_alpha && !_flagTwo);
+ return _file->eos() || playFirstFrame();
}
bool ROQPlayer::readBlockHeader(ROQBlockHeader &blockHeader) {
@@ -492,7 +492,7 @@ bool ROQPlayer::processBlockSoundMono(ROQBlockHeader &blockHeader) {
}
// Initialize the audio stream if needed
- if (!_audioStream) {
+ if (!_audioStream && !playFirstFrame()) {
_audioStream = Audio::makeQueuingAudioStream(22050, false);
Audio::SoundHandle sound_handle;
g_system->getMixer()->playStream(Audio::Mixer::kPlainSoundType, &sound_handle, _audioStream);
@@ -521,7 +521,10 @@ bool ROQPlayer::processBlockSoundMono(ROQBlockHeader &blockHeader) {
#ifdef SCUMM_LITTLE_ENDIAN
flags |= Audio::FLAG_LITTLE_ENDIAN;
#endif
- _audioStream->queueBuffer((byte *)buffer, blockHeader.size * 2, DisposeAfterUse::YES, flags);
+ if (!playFirstFrame())
+ _audioStream->queueBuffer((byte *)buffer, blockHeader.size * 2, DisposeAfterUse::YES, flags);
+ else
+ free(buffer);
return true;
}
@@ -535,7 +538,7 @@ bool ROQPlayer::processBlockSoundStereo(ROQBlockHeader &blockHeader) {
}
// Initialize the audio stream if needed
- if (!_audioStream) {
+ if (!_audioStream && !playFirstFrame()) {
_audioStream = Audio::makeQueuingAudioStream(22050, true);
Audio::SoundHandle sound_handle;
g_system->getMixer()->playStream(Audio::Mixer::kPlainSoundType, &sound_handle, _audioStream);
@@ -577,7 +580,10 @@ bool ROQPlayer::processBlockSoundStereo(ROQBlockHeader &blockHeader) {
#ifdef SCUMM_LITTLE_ENDIAN
flags |= Audio::FLAG_LITTLE_ENDIAN;
#endif
- _audioStream->queueBuffer((byte *)buffer, blockHeader.size * 2, DisposeAfterUse::YES, flags);
+ if (!playFirstFrame())
+ _audioStream->queueBuffer((byte *)buffer, blockHeader.size * 2, DisposeAfterUse::YES, flags);
+ else
+ free(buffer);
return true;
}
diff --git a/engines/groovie/roq.h b/engines/groovie/roq.h
index b720e6a..ce1a3a2 100644
--- a/engines/groovie/roq.h
+++ b/engines/groovie/roq.h
@@ -57,6 +57,7 @@ private:
bool processBlockSoundMono(ROQBlockHeader &blockHeader);
bool processBlockSoundStereo(ROQBlockHeader &blockHeader);
bool processBlockAudioContainer(ROQBlockHeader &blockHeader);
+ bool playFirstFrame() { return _alpha && !_flagTwo; }
void paint2(byte i, int destx, int desty);
void paint4(byte i, int destx, int desty);
More information about the Scummvm-git-logs
mailing list