Commit 0228a4a5 authored by Warren Dukes's avatar Warren Dukes

uber minor tweaks

git-svn-id: https://svn.musicpd.org/mpd/trunk@1563 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent e1a94f91
...@@ -462,6 +462,7 @@ void decodeParent(PlayerControl * pc, DecoderControl * dc, OutputBuffer * cb) { ...@@ -462,6 +462,7 @@ void decodeParent(PlayerControl * pc, DecoderControl * dc, OutputBuffer * cb) {
dc->state!=DECODE_STATE_STOP) dc->state!=DECODE_STATE_STOP)
{ {
processDecodeInput(); processDecodeInput();
handleDecodeStart();
if(quit) return; if(quit) return;
my_usleep(10000); my_usleep(10000);
} }
...@@ -561,10 +562,10 @@ void decodeParent(PlayerControl * pc, DecoderControl * dc, OutputBuffer * cb) { ...@@ -561,10 +562,10 @@ void decodeParent(PlayerControl * pc, DecoderControl * dc, OutputBuffer * cb) {
quit = 1; quit = 1;
} }
pc->totalPlayTime+= sizeToTime*cb->chunkSize[cb->begin]; pc->totalPlayTime+= sizeToTime*cb->chunkSize[cb->begin];
cb->begin++; if( cb->begin+1 >= buffered_chunks ) {
if(cb->begin>=buffered_chunks) {
cb->begin = 0; cb->begin = 0;
} }
else cb->begin++;
} }
else if(next==cb->begin) { else if(next==cb->begin) {
if(doCrossFade==1 && nextChunk>=0) { if(doCrossFade==1 && nextChunk>=0) {
......
...@@ -57,10 +57,11 @@ void clearOutputBuffer(OutputBuffer * cb) { ...@@ -57,10 +57,11 @@ void clearOutputBuffer(OutputBuffer * cb) {
void flushOutputBuffer(OutputBuffer * cb) { void flushOutputBuffer(OutputBuffer * cb) {
if(currentChunk == cb->end) { if(currentChunk == cb->end) {
cb->end++; int next = cb->end+1;
if(cb->end>=buffered_chunks) { if(next>=buffered_chunks) {
cb->end = 0; next = 0;
} }
cb->end = next;
currentChunk = -1; currentChunk = -1;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment