Commit 77d89a5b authored by Paul B Mahol's avatar Paul B Mahol

apedec: consume packet after it has been fully decoded

Timestamp handling of decoded frames are much simpler now.

Fixes #1675.
Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent c39fb308
......@@ -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)
......
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