uber minor tweaks

git-svn-id: https://svn.musicpd.org/mpd/trunk@1563 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Warren Dukes 2004-06-19 16:27:48 +00:00
parent e1a94f917d
commit 0228a4a5ca
2 changed files with 7 additions and 5 deletions

View File

@ -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) {
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) {

View File

@ -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;
} }
} }