diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-05-19 23:48:34 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-05-19 23:48:34 +0000 |
commit | a81573ef059ac9f006ea438574b1b7ff751ba55d (patch) | |
tree | 84736ed5ad3c296ff9502c407c2ab176023cd90e /src/mp3_decode.c | |
parent | c1fbcd03f04cfb11401174e40f7d451ee3abfff5 (diff) | |
download | mpd-a81573ef059ac9f006ea438574b1b7ff751ba55d.tar.gz mpd-a81573ef059ac9f006ea438574b1b7ff751ba55d.tar.xz mpd-a81573ef059ac9f006ea438574b1b7ff751ba55d.zip |
non-blocking seeking, needs some testing! (this is not just for streams
but new code for files seeking as well)
git-svn-id: https://svn.musicpd.org/mpd/trunk@1099 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/mp3_decode.c')
-rw-r--r-- | src/mp3_decode.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mp3_decode.c b/src/mp3_decode.c index 33c309e7b..2b9fb9748 100644 --- a/src/mp3_decode.c +++ b/src/mp3_decode.c @@ -461,6 +461,7 @@ int mp3Read(mp3DecodeData * data, OutputBuffer * cb, DecoderControl * dc) { if(!dc->seek) data->muteFrame = 0; else if(dc->seekWhere<=data->elapsedTime) { clearOutputBuffer(cb); + dc->seekChunk = cb->end; data->muteFrame = 0; dc->seek = 0; } @@ -517,6 +518,7 @@ int mp3Read(mp3DecodeData * data, OutputBuffer * cb, DecoderControl * dc) { data->frameOffset[i]) == 0) { clearOutputBuffer(cb); + dc->seekChunk = cb->end; data->currentFrame = i; data->muteFrame = 0; } @@ -529,13 +531,13 @@ int mp3Read(mp3DecodeData * data, OutputBuffer * cb, DecoderControl * dc) { while(1) { skip = 0; while((ret = decodeNextFrameHeader(data))==DECODE_CONT && - !dc->seek && !dc->stop); + !dc->stop); if(ret==DECODE_SKIP) skip = 1; - else if(ret==DECODE_BREAK || dc->stop || dc->seek) break; + else if(ret==DECODE_BREAK || dc->stop) break; if(!data->muteFrame) { while((ret = decodeNextFrame(data))==DECODE_CONT && - !dc->seek && !dc->stop); - if(ret==DECODE_BREAK || dc->seek || dc->stop) break; + !dc->stop); + if(ret==DECODE_BREAK || dc->stop) break; } if(!skip && ret==DECODE_OK) break; } |