summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--video/decode/vd_lavc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index 1753bdedda..9b65912fe4 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -868,8 +868,10 @@ static bool send_packet(struct dec_video *vd, struct demux_packet *pkt)
vd_ffmpeg_ctx *ctx = vd->priv;
if (ctx->num_requeue_packets) {
- if (do_send_packet(vd, ctx->requeue_packets[0]))
+ if (do_send_packet(vd, ctx->requeue_packets[0])) {
+ talloc_free(ctx->requeue_packets[0]);
MP_TARRAY_REMOVE_AT(ctx->requeue_packets, ctx->num_requeue_packets, 0);
+ }
return false;
}
@@ -969,6 +971,9 @@ static struct mp_image *receive_frame(struct dec_video *vd)
ctx->requeue_packets = pkts;
ctx->num_requeue_packets = num_pkts;
+
+ if (img)
+ return img;
}
return read_output(vd, eof);