mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-11 19:54:03 +00:00
Make makeMP3Stream return 0 on failure too.
svn-id: r47848
This commit is contained in:
parent
8ae24a27b3
commit
d32dfa3bb3
@ -338,8 +338,13 @@ int MP3Stream::readBuffer(int16 *buffer, const int numSamples) {
|
||||
SeekableAudioStream *makeMP3Stream(
|
||||
Common::SeekableReadStream *stream,
|
||||
DisposeAfterUse::Flag disposeAfterUse) {
|
||||
// TODO: Properly check whether creating the MP3 stream succeeded.
|
||||
return new MP3Stream(stream, disposeAfterUse);
|
||||
SeekableAudioStream *s = new MP3Stream(stream, disposeAfterUse);
|
||||
if (s && s->endOfData()) {
|
||||
delete s;
|
||||
return 0;
|
||||
} else {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
} // End of namespace Audio
|
||||
|
Loading…
Reference in New Issue
Block a user