aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sound/audiostream.cpp26
-rw-r--r--sound/audiostream.h1
2 files changed, 0 insertions, 27 deletions
diff --git a/sound/audiostream.cpp b/sound/audiostream.cpp
index 5d7a3ae4e1..ee86fd9c30 100644
--- a/sound/audiostream.cpp
+++ b/sound/audiostream.cpp
@@ -202,10 +202,8 @@ protected:
byte *_end;
bool _finalized;
const int _rate;
- uint32 _freeSpace;
inline bool eosIntern() const { return _end == _pos; };
- void updateFreeSpace();
public:
AppendableMemoryStream(int rate, uint bufferSize);
~AppendableMemoryStream() { free(_bufferStart); }
@@ -220,21 +218,9 @@ public:
void append(const byte *data, uint32 len);
void finish() { _finalized = true; }
- uint32 getFreeSpace();
};
template<bool stereo, bool is16Bit, bool isUnsigned>
-void AppendableMemoryStream<stereo, is16Bit, isUnsigned>::updateFreeSpace() {
- if (_pos <= _end) {
- uint32 free_from_end = _bufferEnd - _end;
- uint32 free_to_pos = _pos - _bufferStart;
- _freeSpace = free_from_end + free_to_pos;
- } else {
- _freeSpace = _pos - _end;
- }
-}
-
-template<bool stereo, bool is16Bit, bool isUnsigned>
AppendableMemoryStream<stereo, is16Bit, isUnsigned>::AppendableMemoryStream(int rate, uint bufferSize)
: _finalized(false), _rate(rate) {
@@ -247,8 +233,6 @@ AppendableMemoryStream<stereo, is16Bit, isUnsigned>::AppendableMemoryStream(int
_bufferStart = (byte *)malloc(bufferSize);
_pos = _end = _bufferStart;
_bufferEnd = _bufferStart + bufferSize;
-
- updateFreeSpace();
}
template<bool stereo, bool is16Bit, bool isUnsigned>
@@ -262,8 +246,6 @@ inline int16 AppendableMemoryStream<stereo, is16Bit, isUnsigned>::read() {
int16 val = READSAMPLE(is16Bit, isUnsigned, _pos);
_pos += (is16Bit ? 2 : 1);
- updateFreeSpace();
-
return val;
}
@@ -284,8 +266,6 @@ int AppendableMemoryStream<stereo, is16Bit, isUnsigned>::readBuffer(int16 *buffe
}
}
- updateFreeSpace();
-
return samples;
}
@@ -320,12 +300,6 @@ void AppendableMemoryStream<stereo, is16Bit, isUnsigned>::append(const byte *dat
memcpy(_end, data, len);
_end += len;
}
- updateFreeSpace();
-}
-
-template<bool stereo, bool is16Bit, bool isUnsigned>
-uint32 AppendableMemoryStream<stereo, is16Bit, isUnsigned>::getFreeSpace() {
- return _freeSpace;
}
#pragma mark -
diff --git a/sound/audiostream.h b/sound/audiostream.h
index 6cc719d457..ac456233ba 100644
--- a/sound/audiostream.h
+++ b/sound/audiostream.h
@@ -93,7 +93,6 @@ class AppendableAudioStream : public AudioStream {
public:
virtual void append(const byte *data, uint32 len) = 0;
virtual void finish() = 0;
- virtual uint32 getFreeSpace() = 0;
};
class ZeroInputStream : public AudioStream {