VIDEO: Recreate the audiostream if necessary

svn-id: r55324
This commit is contained in:
Sven Hesse 2011-01-19 09:03:09 +00:00
parent adbeb20f3b
commit 679a8d6ad6

View file

@ -1420,13 +1420,18 @@ void IMDDecoder::nextSoundSlice(bool hasNextCmd) {
bool IMDDecoder::initialSoundSlice(bool hasNextCmd) {
int dataLength = _soundSliceSize * _soundSlicesCount;
if (hasNextCmd || !_soundEnabled || !_audioStream) {
if (hasNextCmd || !_soundEnabled) {
// Skip sound
_stream->skip(dataLength);
return false;
}
if (!_audioStream) {
_audioStream = Audio::makeQueuingAudioStream(_soundFreq, false);
_soundStage = kSoundLoaded;
}
// Read, convert, queue
byte *soundBuf = (byte *)malloc(dataLength);