1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-24 07:42:17 +00:00

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.
This commit is contained in:
wm4 2015-10-19 18:19:57 +02:00
parent 0ab6031d76
commit 50f8548b2f

View File

@ -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, &params);
vd->codec_pts = mp_pts_from_av(ctx->pic->pkt_pts, NULL);