From ebfb2c57e14ebfd33876810705f5849a78656b14 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 24 Feb 2007 19:54:54 +0000 Subject: Removed FlacInputStream::deleteBuffer svn-id: r25829 --- sound/flac.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'sound') 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) { -- cgit v1.2.3