mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-01 17:58:29 +00:00
Forgot to release the audio::Buffer for recycling.
This commit is contained in:
parent
d82de7c5c7
commit
8f1ba8bf21
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user