changeset 35411:abece00352ec

Prevent dropping last frames in vd_black.
author upsuper
date Thu, 29 Nov 2012 04:52:19 +0000
parents 1c991ec0e6da
children 2de8e26093c4
files libmpcodecs/vd_black.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_black.c	Wed Nov 28 19:43:03 2012 +0000
+++ b/libmpcodecs/vd_black.c	Thu Nov 29 04:52:19 2012 +0000
@@ -38,6 +38,7 @@
 typedef struct {
     unsigned char *planes[MP_MAX_PLANES];
     int stride[MP_MAX_PLANES];
+    int buffer_filled;
     int w, h;
 } vd_black_ctx;
 
@@ -166,7 +167,9 @@
     vd_black_ctx *ctx = sh->context;
     int i;
 
-    if (sh->num_buffered_pts != FF_ARRAY_ELEMS(sh->buffered_pts) - 1)
+    if (sh->num_buffered_pts == FF_ARRAY_ELEMS(sh->buffered_pts) - 1)
+        ctx->buffer_filled = 1;
+    if (!ctx->buffer_filled || !sh->num_buffered_pts)
         return NULL;
 
     mpi = mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, MP_IMGFLAG_PRESERVE,