From 50f8548b2f11a20cac2b55f6408b3cc4fe5df239 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 19 Oct 2015 18:19:57 +0200 Subject: vd_lavc: attempt to fallback from hwdec before anything is decoded The previous commit moved the av_frame_unref() after the got_picture check. This accidentally also deferred the software fallback reinitialization to until a software picture was decoded (instead of the exact time of the fallback), which is not ideal. Just rely on the fact that calling av_frame_unref() on a frame is ok even if nothing was decoded. --- video/decode/vd_lavc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'video') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 6fdd1b2cfd..5c97526d7c 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -631,15 +631,15 @@ static void decode(struct dec_video *vd, struct demux_packet *packet, return; } - // Skipped frame, or delayed output due to multithreaded decoding. - if (!got_picture) - return; - if (ctx->hwdec && ctx->hwdec_failed) { av_frame_unref(ctx->pic); return; } + // Skipped frame, or delayed output due to multithreaded decoding. + if (!got_picture) + return; + struct mp_image_params params; update_image_params(vd, ctx->pic, ¶ms); vd->codec_pts = mp_pts_from_av(ctx->pic->pkt_pts, NULL); -- cgit v1.2.3