Forgot to release the audio::Buffer for recycling.

This commit is contained in:
Daniel Önnerby 2008-12-24 00:21:33 +00:00
parent d82de7c5c7
commit 8f1ba8bf21
2 changed files with 4 additions and 0 deletions

View File

@ -311,6 +311,7 @@ void Player::ReleaseBuffer(IBuffer *buffer){
for(BufferList::iterator foundBuffer=this->lockedBuffers.begin();foundBuffer!=this->lockedBuffers.end();++foundBuffer){
if(foundBuffer->get()==buffer){
this->totalBufferSize -= buffer->Bytes();
this->stream->DeleteBuffer(*foundBuffer);
this->lockedBuffers.erase(foundBuffer);
// Calculate current position from front locked buffer

View File

@ -49,6 +49,7 @@ namespace musik { namespace core { namespace audio {
// Forward declare
class Stream;
class Player;
typedef boost::shared_ptr<Stream> StreamPtr;
//////////////////////////////////////////////////////////////////////////////
@ -78,6 +79,8 @@ class Stream {
BufferPtr GetNextDecoderBuffer();
BufferPtr GetNextBuffer();
private:
friend class Player;
BufferPtr NewBuffer();
void DeleteBuffer(BufferPtr oldBuffer);