From 651e2760a3b2de0c542ccbbf1bf3caa319cc0349 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 15 Jun 2010 12:33:20 +0000 Subject: Fix spelling, cleanup svn-id: r49843 --- sound/decoders/adpcm.h | 2 +- sound/decoders/flac.cpp | 6 +++--- sound/decoders/flac.h | 4 ++-- sound/decoders/mp3.h | 4 ++-- sound/decoders/vag.h | 2 +- sound/decoders/voc.h | 2 +- sound/decoders/vorbis.h | 4 ++-- sound/decoders/wave.h | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) (limited to 'sound/decoders') 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/flac.cpp b/sound/decoders/flac.cpp index 91c48199e3..e588aa872f 100644 --- a/sound/decoders/flac.cpp +++ b/sound/decoders/flac.cpp @@ -230,7 +230,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 } } @@ -355,7 +355,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()]); } @@ -668,7 +668,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.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, -- cgit v1.2.3 From d570e10b77887fa163f17de512b14fc824f45f33 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 15 Jun 2010 12:33:54 +0000 Subject: Modify makeAIFFStream to match the other sound decoder factories svn-id: r49844 --- sound/decoders/aiff.cpp | 11 ++++++++--- sound/decoders/aiff.h | 9 ++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'sound/decoders') 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 -- cgit v1.2.3 From 830c7611dc76ea94a0869b4943b541035ee28d1c Mon Sep 17 00:00:00 2001 From: Angus Lees Date: Mon, 5 Jul 2010 01:03:52 +0000 Subject: Revert Android libtremor header to standard path, since we now ship our own statically linked version rather than relying on the system shared lib that happens to be on most Android systems. svn-id: r50666 --- sound/decoders/vorbis.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/decoders') diff --git a/sound/decoders/vorbis.cpp b/sound/decoders/vorbis.cpp index 64869d7843..7673c53010 100644 --- a/sound/decoders/vorbis.cpp +++ b/sound/decoders/vorbis.cpp @@ -35,7 +35,7 @@ #include "sound/audiocd.h" #ifdef USE_TREMOR -#if defined(ANDROID) || defined(__GP32__) // custom libtremor locations +#if defined(__GP32__) // custom libtremor locations #include #else #include -- cgit v1.2.3