aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/apedec.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-11-02 19:44:49 +0000
committerPaul B Mahol <onemda@gmail.com>2012-11-02 19:44:49 +0000
commit77d89a5b160127b5b60ba0310cb999077a22525d (patch)
tree22ad647cf07099cb3d8d0c3040f3bf56ccf66408 /libavcodec/apedec.c
parentc39fb308162020ee82310613bf88271c1417d226 (diff)
downloadffmpeg-77d89a5b160127b5b60ba0310cb999077a22525d.tar.gz
apedec: consume packet after it has been fully decoded
Timestamp handling of decoded frames are much simpler now. Fixes #1675. Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/apedec.c')
-rw-r--r--libavcodec/apedec.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index cba3dc0354..2ab0c89c16 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -832,7 +832,6 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
int32_t *sample24;
int i, ch, ret;
int blockstodecode;
- int bytes_used = 0;
/* this should never be negative, but bad things will happen if it is, so
check it just to make sure. */
@@ -887,8 +886,6 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
av_log(avctx, AV_LOG_ERROR, "Error reading frame header\n");
return AVERROR_INVALIDDATA;
}
-
- bytes_used = avpkt->size;
}
if (!s->data) {
@@ -957,7 +954,7 @@ static int ape_decode_frame(AVCodecContext *avctx, void *data,
*got_frame_ptr = 1;
*(AVFrame *)data = s->frame;
- return bytes_used;
+ return !s->samples ? avpkt->size : 0;
}
static void ape_flush(AVCodecContext *avctx)