diff libmpcodecs/vd_ffmpeg.c @ 34772:d32f75f79517

Decode last frames for codecs with delay. Previously they would get lost, which would be particularly extreme when decoding with frame multithreading and lots of threads.
author reimar
date Sun, 15 Apr 2012 15:01:09 +0000
parents 123345d17f3a
children c51421660d5e
line wrap: on
line diff
--- a/libmpcodecs/vd_ffmpeg.c	Sun Apr 15 13:12:56 2012 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Sun Apr 15 15:01:09 2012 +0000
@@ -731,7 +731,7 @@
     int dr1= ctx->do_dr1;
     AVPacket pkt;
 
-    if(len<=0) return NULL; // skipped frame
+    if(data && len<=0) return NULL; // skipped frame
 
 //ffmpeg interlace (mpeg2) bug have been fixed. no need of -noslices
     if (!dr1)
@@ -755,6 +755,7 @@
             avctx->skip_idct = AVDISCARD_ALL;
     }
 
+    if (data)
     mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "vd_ffmpeg data: %04x, %04x, %04x, %04x\n",
            ((int *)data)[0], ((int *)data)[1], ((int *)data)[2], ((int *)data)[3]);
     av_init_packet(&pkt);