changeset 34864:7af545739044

Only try to get a "numbered" mpi for nonref DR. This is simpler, more flexible and more robust. Should fix bug #2067.
author reimar
date Mon, 21 May 2012 20:00:03 +0000
parents 04cd132753bc
children a8b2db27349e
files libmpcodecs/vd_ffmpeg.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_ffmpeg.c	Mon May 21 20:00:01 2012 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Mon May 21 20:00:03 2012 +0000
@@ -564,11 +564,11 @@
     }
 
     if (ctx->nonref_dr) {
-        if (flags & MP_IMGFLAG_PRESERVE || ctx->b_count > 1) {
-            if (!(flags & MP_IMGFLAG_PRESERVE)) ctx->b_count--;
+        if (flags & MP_IMGFLAG_PRESERVE)
             return avcodec_default_get_buffer(avctx, pic);
-        }
-        type = MP_IMGTYPE_TEMP;
+        // Use NUMBERED since for e.g. TEMP vos assume there will
+        // be no other frames between the get_image and matching put_image.
+        type = MP_IMGTYPE_NUMBERED;
     }
 
     if(init_vo(sh, avctx->pix_fmt) < 0){