Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
7fa3b7a2
Commit
7fa3b7a2
authored
Sep 26, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PlayerThread: simplify "buffer empty" assertion
parent
f3fc76e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
MusicBuffer.hxx
src/MusicBuffer.hxx
+11
-0
PlayerThread.cxx
src/PlayerThread.cxx
+1
-7
No files found.
src/MusicBuffer.hxx
View file @
7fa3b7a2
...
...
@@ -43,6 +43,17 @@ public:
*/
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
* is the same value which was passed to the constructor
...
...
src/PlayerThread.cxx
View file @
7fa3b7a2
...
...
@@ -1143,13 +1143,7 @@ player_task(gpointer arg)
pc
->
Lock
();
player_command_finished_locked
(
pc
);
#ifndef NDEBUG
/* 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
assert
(
player_buffer
->
IsEmptyUnsafe
());
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment