From 70d439736672922f4897f7b5b5e1a21dfae83040 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Thu, 20 May 2004 00:08:22 +0000 Subject: some fixes for non-blocking seek :-) git-svn-id: https://svn.musicpd.org/mpd/trunk@1100 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/aac_decode.c | 12 ------------ src/decode.c | 5 ++++- src/mp4_decode.c | 13 ------------- 3 files changed, 4 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/aac_decode.c b/src/aac_decode.c index 70ec21dd6..9391d3539 100644 --- a/src/aac_decode.c +++ b/src/aac_decode.c @@ -264,7 +264,6 @@ int aac_decode(OutputBuffer * cb, DecoderControl * dc) { unsigned int sampleCount; char * sampleBuffer; size_t sampleBufferLen; - int chunkLen = 0; /*float * seekTable; long seekTableEnd = -1; int seekPositionFound = 0;*/ @@ -383,17 +382,6 @@ int aac_decode(OutputBuffer * cb, DecoderControl * dc) { if(dc->state != DECODE_STATE_DECODE) return -1; - if(!dc->stop && chunkLen>0) { - cb->chunkSize[cb->end] = chunkLen; - ++cb->end; - - if(cb->end>=buffered_chunks) { - cb->end = 0; - cb->wrap = 1; - } - chunkLen = 0; - } - if(dc->seek) dc->seek = 0; if(dc->stop) { diff --git a/src/decode.c b/src/decode.c index af5ca2c21..e3f13fada 100644 --- a/src/decode.c +++ b/src/decode.c @@ -410,7 +410,10 @@ void decodeParent(PlayerControl * pc, DecoderControl * dc, OutputBuffer * cb) { processDecodeInput(); handleDecodeStart(); if(!dc->seek && seeking) { - if(dc->seekChunk >= 0) cb->begin = dc->seekChunk; + if(dc->seekChunk >= 0) { + cb->begin = dc->seekChunk; + cb->wrap = 0; + } seeking = 0; } if(dc->state==DECODE_STATE_STOP && diff --git a/src/mp4_decode.c b/src/mp4_decode.c index b94023df8..f837bdacd 100644 --- a/src/mp4_decode.c +++ b/src/mp4_decode.c @@ -105,7 +105,6 @@ int mp4_decode(OutputBuffer * cb, DecoderControl * dc) { char * sampleBuffer; size_t sampleBufferLen; unsigned int initial = 1; - int chunkLen = 0; float * seekTable; long seekTableEnd = -1; int seekPositionFound = 0; @@ -219,7 +218,6 @@ int mp4_decode(OutputBuffer * cb, DecoderControl * dc) { if(dc->seek && seekPositionFound) { seekPositionFound = 0; - chunkLen = 0; clearOutputBuffer(cb); dc->seekChunk = cb->end; dc->seek = 0; @@ -299,17 +297,6 @@ int mp4_decode(OutputBuffer * cb, DecoderControl * dc) { if(dc->state != DECODE_STATE_DECODE) return -1; - if(!dc->stop && !dc->seek && chunkLen>0) { - cb->chunkSize[cb->end] = chunkLen; - ++cb->end; - - if(cb->end>=buffered_chunks) { - cb->end = 0; - cb->wrap = 1; - } - chunkLen = 0; - } - if(dc->seek) dc->seek = 0; if(dc->stop) { -- cgit v1.2.3