[FFmpeg-cvslog] apedec: consume packet after it has been fully decoded

Paul B Mahol git at videolan.org
Fri Nov 2 20:52:59 CET 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Nov  2 19:44:49 2012 +0000| [77d89a5b160127b5b60ba0310cb999077a22525d] | committer: 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: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=77d89a5b160127b5b60ba0310cb999077a22525d
---

 libavcodec/apedec.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index cba3dc0..2ab0c89 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)



More information about the ffmpeg-cvslog mailing list