mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-08 03:47:32 +00:00
Stop SubLoopingAudioStream playback, in case reading from the parent stream fails.
svn-id: r48021
This commit is contained in:
parent
6a624df560
commit
b097e8635c
@ -187,7 +187,11 @@ int SubLoopingAudioStream::readBuffer(int16 *buffer, const int numSamples) {
|
||||
int framesRead = _parent->readBuffer(buffer, framesLeft);
|
||||
_pos = _pos.addFrames(framesRead);
|
||||
|
||||
if (_pos == _loopEnd) {
|
||||
if (framesRead < framesLeft) {
|
||||
// TODO: Proper error indication.
|
||||
_done = true;
|
||||
return framesRead;
|
||||
} else if (_pos == _loopEnd) {
|
||||
if (_loops != 0) {
|
||||
--_loops;
|
||||
if (!_loops) {
|
||||
@ -197,6 +201,7 @@ int SubLoopingAudioStream::readBuffer(int16 *buffer, const int numSamples) {
|
||||
}
|
||||
|
||||
if (!_parent->seek(_loopStart)) {
|
||||
// TODO: Proper error indication.
|
||||
_done = true;
|
||||
return framesRead;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user