# HG changeset patch # User upsuper # Date 1354164739 0 # Node ID abece00352ec193a7a357376f5a52b48a2b50f74 # Parent 1c991ec0e6da12156775abf0348da7258e6bb1e5 Prevent dropping last frames in vd_black. diff -r 1c991ec0e6da -r abece00352ec libmpcodecs/vd_black.c --- 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,