1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-25 16:33:02 +00:00

vd_lavc: fix some leaks and a discarded frame on hwdec fallback

Wasn't a problem in most normal scenarios.
This commit is contained in:
wm4 2017-01-11 08:27:46 +01:00
parent c2c065913b
commit 902424d065

View File

@ -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);