add method availableOutputBuffer()
The method availableOutputBuffer() calculates how many chunks are in use. This simplifies code which needs this information, and it can run without knowing OutputBuffer internals. The function knows how to calculate this when begin>end; this might have been a bug in decodeParent(), which does not. git-svn-id: https://svn.musicpd.org/mpd/trunk@7250 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
committed by
Eric Wong
parent
0defe87da7
commit
a7b19012d3
@@ -425,8 +425,7 @@ static void decodeParent(PlayerControl * pc, DecoderControl * dc, OutputBuffer *
|
||||
pc->play = 0;
|
||||
wakeup_main_task();
|
||||
|
||||
while ((unsigned)cb->end - cb->begin < bbp &&
|
||||
cb->end != buffered_chunks - 1 &&
|
||||
while (availableOutputBuffer(cb) < bbp &&
|
||||
dc->state != DECODE_STATE_STOP) {
|
||||
processDecodeInput();
|
||||
player_sleep();
|
||||
|
||||
Reference in New Issue
Block a user