diff libmpcodecs/vd_ffmpeg.c @ 34813:183979fd93d9

Fix direct rendering for H.264. H.264 files without B-frames would fail to play completely with "Too many buffered pts" messages.
author reimar
date Tue, 15 May 2012 17:54:31 +0000
parents ea97bcb28df1
children 0640d4451aa7
line wrap: on
line diff
--- a/libmpcodecs/vd_ffmpeg.c	Mon May 14 20:24:43 2012 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Tue May 15 17:54:31 2012 +0000
@@ -798,7 +798,10 @@
     pkt.size = 0;
     av_destruct_packet(&pkt);
 
-    dr1= ctx->do_dr1;
+    // even when we do dr we might actually get a buffer we had
+    // FFmpeg allocate - this mostly happens with nonref_dr.
+    // Ensure we treat it correctly.
+    dr1= ctx->do_dr1 && pic->type == FF_BUFFER_TYPE_USER;
     if(ret<0) mp_msg(MSGT_DECVIDEO, MSGL_WARN, "Error while decoding frame!\n");
 //printf("repeat: %d\n", pic->repeat_pict);
 //-- vstats generation