PlayerThread: simplify "buffer empty" assertion
This commit is contained in:
parent
f3fc76e3c8
commit
7fa3b7a267
@ -43,6 +43,17 @@ public:
|
|||||||
*/
|
*/
|
||||||
MusicBuffer(unsigned num_chunks);
|
MusicBuffer(unsigned num_chunks);
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
/**
|
||||||
|
* Check whether the buffer is empty. This call is not
|
||||||
|
* protected with the mutex, and may only be used while this
|
||||||
|
* object is inaccessible to other threads.
|
||||||
|
*/
|
||||||
|
bool IsEmptyUnsafe() const {
|
||||||
|
return buffer.IsEmpty();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the total number of reserved chunks in this buffer. This
|
* Returns the total number of reserved chunks in this buffer. This
|
||||||
* is the same value which was passed to the constructor
|
* is the same value which was passed to the constructor
|
||||||
|
@ -1143,13 +1143,7 @@ player_task(gpointer arg)
|
|||||||
pc->Lock();
|
pc->Lock();
|
||||||
player_command_finished_locked(pc);
|
player_command_finished_locked(pc);
|
||||||
|
|
||||||
#ifndef NDEBUG
|
assert(player_buffer->IsEmptyUnsafe());
|
||||||
/* in the DEBUG build, check for leaked
|
|
||||||
music_chunk objects by freeing the
|
|
||||||
music_buffer */
|
|
||||||
delete player_buffer;
|
|
||||||
player_buffer = new MusicBuffer(pc->buffer_chunks);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user