[FFmpeg-soc] [soc]: r759 - dirac/libavcodec/dirac.c

marco subversion at mplayerhq.hu
Tue Aug 14 02:54:49 CEST 2007


Author: marco
Date: Tue Aug 14 02:54:49 2007
New Revision: 759

Log:
make sure all decoded frames will be returned

Modified:
   dirac/libavcodec/dirac.c

Modified: dirac/libavcodec/dirac.c
==============================================================================
--- dirac/libavcodec/dirac.c	(original)
+++ dirac/libavcodec/dirac.c	Tue Aug 14 02:54:49 2007
@@ -2677,7 +2677,21 @@ static int decode_frame(AVCodecContext *
     GetBitContext gb;
     AVFrame *picture = data;
     int i;
-    int parse_code = buf[4];
+    int parse_code;
+
+    if (buf_size == 0) {
+        int idx = reference_frame_idx(avctx, avctx->frame_number);
+        if (idx == -1) {
+            /* The frame was not found.  */
+            *data_size = 0;
+        } else {
+            *data_size = sizeof(AVFrame);
+            *picture = s->refframes[idx].frame;
+        }
+        return 0;
+    }
+
+    parse_code = buf[4];
 
     dprintf(avctx, "Decoding frame: size=%d head=%c%c%c%c parse=%02x\n",
             buf_size, buf[0], buf[1], buf[2], buf[3], buf[4]);
@@ -2842,7 +2856,7 @@ AVCodec dirac_decoder = {
     NULL,
     decode_end,
     decode_frame,
-    0,
+    CODEC_CAP_DELAY,
     NULL
 };
 



More information about the FFmpeg-soc mailing list