[Scummvm-git-logs] scummvm master -> 9dd74858e478efa314556d11eedfc43332b9b79c
criezy
criezy at scummvm.org
Sun Apr 11 01:22:24 UTC 2021
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:
9dd74858e4 AGS: Remove assert when trying to create looping audio stream
Commit: 9dd74858e478efa314556d11eedfc43332b9b79c
https://github.com/scummvm/scummvm/commit/9dd74858e478efa314556d11eedfc43332b9b79c
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-04-11T02:21:39+01:00
Commit Message:
AGS: Remove assert when trying to create looping audio stream
When trying to create a looping stream from a non-seakable
stream the code was asserting. This happened for example
with MOD audio streams. Those are usually already looping
built-in, so we might be fine. But in any case even only
playing it once is better than a crash.
This also avoids the assert when we failed to create the
audio stream (for example for 24 bits WAV audio).
Changed paths:
engines/ags/engine/media/audio/soundclip.cpp
diff --git a/engines/ags/engine/media/audio/soundclip.cpp b/engines/ags/engine/media/audio/soundclip.cpp
index d688758a12..cfb9171290 100644
--- a/engines/ags/engine/media/audio/soundclip.cpp
+++ b/engines/ags/engine/media/audio/soundclip.cpp
@@ -41,8 +41,8 @@ SoundClipWaveBase::SoundClipWaveBase(Audio::AudioStream *stream, int volume, boo
if (repeat) {
Audio::SeekableAudioStream *str = dynamic_cast<Audio::SeekableAudioStream *>(stream);
- assert(str);
- _stream = new Audio::LoopingAudioStream(str, 0);
+ if (str)
+ _stream = new Audio::LoopingAudioStream(str, 0);
}
}
More information about the Scummvm-git-logs
mailing list