[Scummvm-cvs-logs] scummvm master -> 3a1de9a1828dccac216cc9833de0b8c06a681d07

wjp wjp at usecode.org
Sun Apr 21 13:55:44 CEST 2013


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:
3a1de9a182 AUDIO: Handle empty parent stream in LoopingAudioStream


Commit: 3a1de9a1828dccac216cc9833de0b8c06a681d07
    https://github.com/scummvm/scummvm/commit/3a1de9a1828dccac216cc9833de0b8c06a681d07
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2013-04-21T04:52:40-07:00

Commit Message:
AUDIO: Handle empty parent stream in LoopingAudioStream

This should fix bug #3571139.

Changed paths:
    audio/audiostream.cpp



diff --git a/audio/audiostream.cpp b/audio/audiostream.cpp
index 2d65d4a..8bd4b95 100644
--- a/audio/audiostream.cpp
+++ b/audio/audiostream.cpp
@@ -98,6 +98,10 @@ LoopingAudioStream::LoopingAudioStream(RewindableAudioStream *stream, uint loops
 		// TODO: Properly indicate error
 		_loops = _completeIterations = 1;
 	}
+	if (stream->endOfData()) {
+		// Apparently this is an empty stream
+		_loops = _completeIterations = 1;
+	}
 }
 
 int LoopingAudioStream::readBuffer(int16 *buffer, const int numSamples) {
@@ -118,6 +122,10 @@ int LoopingAudioStream::readBuffer(int16 *buffer, const int numSamples) {
 			_loops = _completeIterations = 1;
 			return samplesRead;
 		}
+		if (_parent->endOfData()) {
+			// Apparently this is an empty stream
+			_loops = _completeIterations = 1;
+		}
 
 		return samplesRead + readBuffer(buffer + samplesRead, remainingSamples);
 	}






More information about the Scummvm-git-logs mailing list