diff options
author | Alejandro Marzini | 2010-07-13 04:31:15 +0000 |
---|---|---|
committer | Alejandro Marzini | 2010-07-13 04:31:15 +0000 |
commit | 609e08d5dbae3179eddf981abe73d69009432de4 (patch) | |
tree | cddbd0a0e69eaa53b85f98f96dc410a307773f08 /sound/decoders | |
parent | 8b6a670391f1b5103e3761d78eef8f41d64cf8cd (diff) | |
parent | 03c0faa5d76f547603ee6389cdf958e2a6f0f43d (diff) | |
download | scummvm-rg350-609e08d5dbae3179eddf981abe73d69009432de4.tar.gz scummvm-rg350-609e08d5dbae3179eddf981abe73d69009432de4.tar.bz2 scummvm-rg350-609e08d5dbae3179eddf981abe73d69009432de4.zip |
Merged from trunk, from Rev 49499 to HEAD
svn-id: r50840
Diffstat (limited to 'sound/decoders')
-rw-r--r-- | sound/decoders/adpcm.h | 2 | ||||
-rw-r--r-- | sound/decoders/aiff.cpp | 11 | ||||
-rw-r--r-- | sound/decoders/aiff.h | 9 | ||||
-rw-r--r-- | sound/decoders/flac.cpp | 6 | ||||
-rw-r--r-- | sound/decoders/flac.h | 4 | ||||
-rw-r--r-- | sound/decoders/mp3.h | 4 | ||||
-rw-r--r-- | sound/decoders/vag.h | 2 | ||||
-rw-r--r-- | sound/decoders/voc.h | 2 | ||||
-rw-r--r-- | sound/decoders/vorbis.cpp | 2 | ||||
-rw-r--r-- | sound/decoders/vorbis.h | 4 | ||||
-rw-r--r-- | sound/decoders/wave.h | 4 |
11 files changed, 31 insertions, 19 deletions
diff --git a/sound/decoders/adpcm.h b/sound/decoders/adpcm.h index 7452478f35..04dbb1a521 100644 --- a/sound/decoders/adpcm.h +++ b/sound/decoders/adpcm.h @@ -71,7 +71,7 @@ enum typesADPCM { * @param rate the sampling rate * @param channels the number of channels * @param blockAlign block alignment ??? - * @return a new RewindableAudioStream, or NULL, if an error occured + * @return a new RewindableAudioStream, or NULL, if an error occurred */ RewindableAudioStream *makeADPCMStream( Common::SeekableReadStream *stream, 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); diff --git a/sound/decoders/aiff.h b/sound/decoders/aiff.h index e8a3b6f0b0..53f86c95fd 100644 --- a/sound/decoders/aiff.h +++ b/sound/decoders/aiff.h @@ -34,6 +34,7 @@ #define SOUND_AIFF_H #include "common/scummsys.h" +#include "common/types.h" namespace Common { class SeekableReadStream; } @@ -55,8 +56,14 @@ extern bool loadAIFFFromStream(Common::SeekableReadStream &stream, int &size, in * from that data. * * This function uses loadAIFFFromStream() internally. + * + * @param stream the SeekableReadStream from which to read the AIFF data + * @param disposeAfterUse whether to delete the stream after use + * @return a new SeekableAudioStream, or NULL, if an error occurred */ -SeekableAudioStream *makeAIFFStream(Common::SeekableReadStream &stream); +SeekableAudioStream *makeAIFFStream( + Common::SeekableReadStream *stream, + DisposeAfterUse::Flag disposeAfterUse); } // End of namespace Audio diff --git a/sound/decoders/flac.cpp b/sound/decoders/flac.cpp index fb9499e31f..2a92735616 100644 --- a/sound/decoders/flac.cpp +++ b/sound/decoders/flac.cpp @@ -229,7 +229,7 @@ FLACStream::FLACStream(Common::SeekableReadStream *inStream, bool dispose) if (processUntilEndOfMetadata() && _streaminfo.channels > 0) { _lastSample = _streaminfo.total_samples + 1; _length = Timestamp(0, _lastSample - 1, getRate()); - return; // no error occured + return; // no error occurred } } @@ -354,7 +354,7 @@ int FLACStream::readBuffer(int16 *buffer, const int numSamples) { break; default: decoderOk = false; - warning("FLACStream: An error occured while decoding. DecoderState is: %s", + warning("FLACStream: An error occurred while decoding. DecoderState is: %s", FLAC__StreamDecoderStateString[getStreamDecoderState()]); } @@ -667,7 +667,7 @@ inline void FLACStream::callbackMetadata(const ::FLAC__StreamMetadata *metadata) } inline void FLACStream::callbackError(::FLAC__StreamDecoderErrorStatus status) { // some of these are non-critical-Errors - debug(1, "FLACStream: An error occured while decoding. DecoderState is: %s", + debug(1, "FLACStream: An error occurred while decoding. DecoderState is: %s", FLAC__StreamDecoderErrorStatusString[status]); } diff --git a/sound/decoders/flac.h b/sound/decoders/flac.h index 982450c045..3c00ec3d5d 100644 --- a/sound/decoders/flac.h +++ b/sound/decoders/flac.h @@ -41,8 +41,8 @@ #ifndef SOUND_FLAC_H #define SOUND_FLAC_H -#include "common/types.h" #include "common/scummsys.h" +#include "common/types.h" #ifdef USE_FLAC @@ -61,7 +61,7 @@ class SeekableAudioStream; * * @param stream the SeekableReadStream from which to read the FLAC data * @param disposeAfterUse whether to delete the stream after use - * @return a new SeekableAudioStream, or NULL, if an error occured + * @return a new SeekableAudioStream, or NULL, if an error occurred */ SeekableAudioStream *makeFLACStream( Common::SeekableReadStream *stream, diff --git a/sound/decoders/mp3.h b/sound/decoders/mp3.h index 3175df5e92..ed54c8b013 100644 --- a/sound/decoders/mp3.h +++ b/sound/decoders/mp3.h @@ -41,8 +41,8 @@ #ifndef SOUND_MP3_H #define SOUND_MP3_H -#include "common/types.h" #include "common/scummsys.h" +#include "common/types.h" #ifdef USE_MAD @@ -61,7 +61,7 @@ class SeekableAudioStream; * * @param stream the SeekableReadStream from which to read the MP3 data * @param disposeAfterUse whether to delete the stream after use - * @return a new SeekableAudioStream, or NULL, if an error occured + * @return a new SeekableAudioStream, or NULL, if an error occurred */ SeekableAudioStream *makeMP3Stream( Common::SeekableReadStream *stream, diff --git a/sound/decoders/vag.h b/sound/decoders/vag.h index 7e0ed255be..cdf91a8ea1 100644 --- a/sound/decoders/vag.h +++ b/sound/decoders/vag.h @@ -49,7 +49,7 @@ class RewindableAudioStream; * * @param stream the SeekableReadStream from which to read the ADPCM data * @param rate the sampling rate - * @return a new RewindableAudioStream, or NULL, if an error occured + * @return a new RewindableAudioStream, or NULL, if an error occurred */ RewindableAudioStream *makeVagStream( Common::SeekableReadStream *stream, diff --git a/sound/decoders/voc.h b/sound/decoders/voc.h index 79956ee62a..82cc261f2c 100644 --- a/sound/decoders/voc.h +++ b/sound/decoders/voc.h @@ -38,8 +38,8 @@ #ifndef SOUND_VOC_H #define SOUND_VOC_H -#include "common/types.h" #include "common/scummsys.h" +#include "common/types.h" namespace Common { class ReadStream; } namespace Common { class SeekableReadStream; } diff --git a/sound/decoders/vorbis.cpp b/sound/decoders/vorbis.cpp index a8ac7784f5..5aeb40c139 100644 --- a/sound/decoders/vorbis.cpp +++ b/sound/decoders/vorbis.cpp @@ -34,7 +34,7 @@ #include "sound/audiostream.h" #ifdef USE_TREMOR -#if defined(ANDROID) || defined(__GP32__) // custom libtremor locations +#if defined(__GP32__) // custom libtremor locations #include <ivorbisfile.h> #else #include <tremor/ivorbisfile.h> diff --git a/sound/decoders/vorbis.h b/sound/decoders/vorbis.h index dd0a89bfdd..0a0cf43bc9 100644 --- a/sound/decoders/vorbis.h +++ b/sound/decoders/vorbis.h @@ -41,8 +41,8 @@ #ifndef SOUND_VORBIS_H #define SOUND_VORBIS_H -#include "common/types.h" #include "common/scummsys.h" +#include "common/types.h" #ifdef USE_VORBIS @@ -61,7 +61,7 @@ class SeekableAudioStream; * * @param stream the SeekableReadStream from which to read the Ogg Vorbis data * @param disposeAfterUse whether to delete the stream after use - * @return a new SeekableAudioStream, or NULL, if an error occured + * @return a new SeekableAudioStream, or NULL, if an error occurred */ SeekableAudioStream *makeVorbisStream( Common::SeekableReadStream *stream, diff --git a/sound/decoders/wave.h b/sound/decoders/wave.h index f0e3bb249b..edd37e7ac9 100644 --- a/sound/decoders/wave.h +++ b/sound/decoders/wave.h @@ -38,8 +38,8 @@ #ifndef SOUND_WAVE_H #define SOUND_WAVE_H -#include "common/types.h" #include "common/scummsys.h" +#include "common/types.h" namespace Common { class SeekableReadStream; } @@ -71,7 +71,7 @@ extern bool loadWAVFromStream( * * @param stream the SeekableReadStream from which to read the WAVE data * @param disposeAfterUse whether to delete the stream after use - * @return a new RewindableAudioStream, or NULL, if an error occured + * @return a new RewindableAudioStream, or NULL, if an error occurred */ RewindableAudioStream *makeWAVStream( Common::SeekableReadStream *stream, |