diff options
author | Max Horn | 2007-02-24 19:54:54 +0000 |
---|---|---|
committer | Max Horn | 2007-02-24 19:54:54 +0000 |
commit | ebfb2c57e14ebfd33876810705f5849a78656b14 (patch) | |
tree | 2943935ca6f16cabd16d25524f3f7a71cae3682c /sound | |
parent | 8fa6a1ffd54c913292bb01786acc2bbfbd8c149d (diff) | |
download | scummvm-rg350-ebfb2c57e14ebfd33876810705f5849a78656b14.tar.gz scummvm-rg350-ebfb2c57e14ebfd33876810705f5849a78656b14.tar.bz2 scummvm-rg350-ebfb2c57e14ebfd33876810705f5849a78656b14.zip |
Removed FlacInputStream::deleteBuffer
svn-id: r25829
Diffstat (limited to 'sound')
-rw-r--r-- | sound/flac.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/sound/flac.cpp b/sound/flac.cpp index 00dd3e9987..530bbd29ff 100644 --- a/sound/flac.cpp +++ b/sound/flac.cpp @@ -135,7 +135,6 @@ protected: uint getChannels() const { return MIN(_streaminfo.channels, MAX_OUTPUT_CHANNELS); } bool allocateBuffer(uint minSamples); - inline void deleteBuffer(); inline FLAC__StreamDecoderState getStreamDecoderState() const; @@ -192,7 +191,6 @@ FlacInputStream::FlacInputStream(Common::SeekableReadStream *inStream, bool disp _preBuffer.bufFill = 0; _preBuffer.bufSize = 0; - deleteBuffer(); _lastSampleWritten = false; _methodConvertBuffers = &FlacInputStream::convertBuffersGeneric; @@ -385,16 +383,6 @@ inline ::FLAC__SeekableStreamDecoderReadStatus FlacInputStream::callbackRead(FLA #endif } -inline void FlacInputStream::deleteBuffer() { - _lastSampleWritten = _lastSampleWritten && _preBuffer.bufFill == 0; - _preBuffer.bufFill = 0; - _preBuffer.bufSize = 0; - if (_preBuffer.bufData != NULL) { - delete[] _preBuffer.bufData; - _preBuffer.bufData = NULL; - } -} - bool FlacInputStream::allocateBuffer(uint minSamples) { uint allocateSize = minSamples / getChannels(); /** insert funky algorythm for optimum buffersize here */ @@ -402,7 +390,10 @@ bool FlacInputStream::allocateBuffer(uint minSamples) { allocateSize += 8 - (allocateSize % 8); // make sure its an nice even amount allocateSize *= getChannels(); - deleteBuffer(); + _lastSampleWritten = _lastSampleWritten && _preBuffer.bufFill == 0; + _preBuffer.bufFill = 0; + _preBuffer.bufSize = 0; + delete[] _preBuffer.bufData; _preBuffer.bufData = new SampleType[allocateSize]; if (_preBuffer.bufData != NULL) { |