[Scummvm-cvs-logs] SF.net SVN: scummvm:[47848] scummvm/trunk/sound/decoders/mp3.cpp
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Wed Feb 3 10:47:29 CET 2010
Revision: 47848
http://scummvm.svn.sourceforge.net/scummvm/?rev=47848&view=rev
Author: lordhoto
Date: 2010-02-03 09:47:29 +0000 (Wed, 03 Feb 2010)
Log Message:
-----------
Make makeMP3Stream return 0 on failure too.
Modified Paths:
--------------
scummvm/trunk/sound/decoders/mp3.cpp
Modified: scummvm/trunk/sound/decoders/mp3.cpp
===================================================================
--- scummvm/trunk/sound/decoders/mp3.cpp 2010-02-03 09:42:40 UTC (rev 47847)
+++ scummvm/trunk/sound/decoders/mp3.cpp 2010-02-03 09:47:29 UTC (rev 47848)
@@ -338,8 +338,13 @@
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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list