changeset 34816:0640d4451aa7

Do not provide multiple B-frames for direct rendering. Fixes some extreme stuttering with some H.264 samples.
author reimar
date Tue, 15 May 2012 21:18:37 +0000
parents 049b24e18a65
children 326242b21831
files libmpcodecs/vd_ffmpeg.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_ffmpeg.c	Tue May 15 20:56:53 2012 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Tue May 15 21:18:37 2012 +0000
@@ -563,8 +563,10 @@
     }
 
     if (ctx->nonref_dr) {
-        if (flags & MP_IMGFLAG_PRESERVE)
+        if (flags & MP_IMGFLAG_PRESERVE || ctx->b_count > 1) {
+            if (!(flags & MP_IMGFLAG_PRESERVE)) ctx->b_count--;
             return avcodec_default_get_buffer(avctx, pic);
+        }
         type = MP_IMGTYPE_TEMP;
     }