summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-01-11 08:27:46 +0100
committerwm4 <wm4@nowhere>2017-01-11 08:34:08 +0100
commit902424d065bab52185fc2d0b177ce75012e71819 (patch)
treea9dbb04aa106c2f456ac69124e7ba1fae1436886 /video
parentc2c065913b9064111c24e4d2feb8763c22b288e3 (diff)
downloadmpv-902424d065bab52185fc2d0b177ce75012e71819.tar.bz2
mpv-902424d065bab52185fc2d0b177ce75012e71819.tar.xz
vd_lavc: fix some leaks and a discarded frame on hwdec fallback
Wasn't a problem in most normal scenarios.
Diffstat (limited to 'video')
-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);