diff options
author | Max Horn | 2010-06-15 12:33:54 +0000 |
---|---|---|
committer | Max Horn | 2010-06-15 12:33:54 +0000 |
commit | d570e10b77887fa163f17de512b14fc824f45f33 (patch) | |
tree | 44dbf95c8ad21df54d793cf22b2f3590ccb1ef77 /sound/decoders/aiff.cpp | |
parent | 651e2760a3b2de0c542ccbbf1bf3caa319cc0349 (diff) | |
download | scummvm-rg350-d570e10b77887fa163f17de512b14fc824f45f33.tar.gz scummvm-rg350-d570e10b77887fa163f17de512b14fc824f45f33.tar.bz2 scummvm-rg350-d570e10b77887fa163f17de512b14fc824f45f33.zip |
Modify makeAIFFStream to match the other sound decoder factories
svn-id: r49844
Diffstat (limited to 'sound/decoders/aiff.cpp')
-rw-r--r-- | sound/decoders/aiff.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sound/decoders/aiff.cpp b/sound/decoders/aiff.cpp index 2f12669072..b76410f8d1 100644 --- a/sound/decoders/aiff.cpp +++ b/sound/decoders/aiff.cpp @@ -161,16 +161,21 @@ bool loadAIFFFromStream(Common::SeekableReadStream &stream, int &size, int &rate return true; } -SeekableAudioStream *makeAIFFStream(Common::SeekableReadStream &stream) { +SeekableAudioStream *makeAIFFStream(Common::SeekableReadStream *stream, + DisposeAfterUse::Flag disposeAfterUse) { int size, rate; byte *data, flags; - if (!loadAIFFFromStream(stream, size, rate, flags)) + if (!loadAIFFFromStream(*stream, size, rate, flags)) { + if (disposeAfterUse == DisposeAfterUse::YES) + delete stream; return 0; + } data = (byte *)malloc(size); assert(data); - stream.read(data, size); + stream->read(data, size); + delete stream; // Since we allocated our own buffer for the data, we must specify DisposeAfterUse::YES. return makeRawStream(data, size, rate, flags); |