[Scummvm-git-logs] scummvm master -> 44d8aa33fb9ccae923b54dc031752b8b3ca90ac3
sev-
sev at scummvm.org
Sat Aug 29 00:17:32 UTC 2020
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
30d67ced36 AUDIO: Added flag to skip rewinding in LoopingAudioStream
44d8aa33fb LAB: Do not rewind stream on music change. Fixes #7015
Commit: 30d67ced36605d1d643c1d83936b5953bcc1afee
https://github.com/scummvm/scummvm/commit/30d67ced36605d1d643c1d83936b5953bcc1afee
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-29T02:17:18+02:00
Commit Message:
AUDIO: Added flag to skip rewinding in LoopingAudioStream
Changed paths:
audio/audiostream.cpp
audio/audiostream.h
diff --git a/audio/audiostream.cpp b/audio/audiostream.cpp
index 88c41e8503..a556f1266d 100644
--- a/audio/audiostream.cpp
+++ b/audio/audiostream.cpp
@@ -91,11 +91,11 @@ SeekableAudioStream *SeekableAudioStream::openStreamFile(const Common::String &b
#pragma mark --- LoopingAudioStream ---
#pragma mark -
-LoopingAudioStream::LoopingAudioStream(RewindableAudioStream *stream, uint loops, DisposeAfterUse::Flag disposeAfterUse)
+LoopingAudioStream::LoopingAudioStream(RewindableAudioStream *stream, uint loops, DisposeAfterUse::Flag disposeAfterUse, bool rewind)
: _parent(stream, disposeAfterUse), _loops(loops), _completeIterations(0) {
assert(stream);
- if (!stream->rewind()) {
+ if (rewind && !stream->rewind()) {
// TODO: Properly indicate error
_loops = _completeIterations = 1;
}
diff --git a/audio/audiostream.h b/audio/audiostream.h
index a60d5a2086..7f9bbe0563 100644
--- a/audio/audiostream.h
+++ b/audio/audiostream.h
@@ -118,7 +118,7 @@ public:
* @param loops How often to loop (0 = infinite)
* @param disposeAfterUse Destroy the stream after the LoopingAudioStream has finished playback.
*/
- LoopingAudioStream(RewindableAudioStream *stream, uint loops, DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES);
+ LoopingAudioStream(RewindableAudioStream *stream, uint loops, DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::YES, bool rewind = true);
int readBuffer(int16 *buffer, const int numSamples);
bool endOfData() const;
Commit: 44d8aa33fb9ccae923b54dc031752b8b3ca90ac3
https://github.com/scummvm/scummvm/commit/44d8aa33fb9ccae923b54dc031752b8b3ca90ac3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-29T02:17:18+02:00
Commit Message:
LAB: Do not rewind stream on music change. Fixes #7015
Changed paths:
engines/lab/music.cpp
diff --git a/engines/lab/music.cpp b/engines/lab/music.cpp
index 579f450456..ae2c926a02 100644
--- a/engines/lab/music.cpp
+++ b/engines/lab/music.cpp
@@ -143,7 +143,7 @@ void Music::changeMusic(const Common::String filename, bool storeCurPos, bool se
_musicFile->seek(_storedPos);
Audio::SeekableAudioStream *audioStream = Audio::makeRawStream(_musicFile, 15000, getSoundFlags());
- _vm->_mixer->playStream(Audio::Mixer::kMusicSoundType, &_musicHandle, new Audio::LoopingAudioStream(audioStream, 0));
+ _vm->_mixer->playStream(Audio::Mixer::kMusicSoundType, &_musicHandle, new Audio::LoopingAudioStream(audioStream, 0, DisposeAfterUse::YES, false));
}
void Music::resetMusic(bool seektoStoredPos) {
More information about the Scummvm-git-logs
mailing list