mirror of https://github.com/mpv-player/mpv
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:
parent
0ab6031d76
commit
50f8548b2f
|
@ -631,15 +631,15 @@ static void decode(struct dec_video *vd, struct demux_packet *packet,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skipped frame, or delayed output due to multithreaded decoding.
|
|
||||||
if (!got_picture)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (ctx->hwdec && ctx->hwdec_failed) {
|
if (ctx->hwdec && ctx->hwdec_failed) {
|
||||||
av_frame_unref(ctx->pic);
|
av_frame_unref(ctx->pic);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skipped frame, or delayed output due to multithreaded decoding.
|
||||||
|
if (!got_picture)
|
||||||
|
return;
|
||||||
|
|
||||||
struct mp_image_params params;
|
struct mp_image_params params;
|
||||||
update_image_params(vd, ctx->pic, ¶ms);
|
update_image_params(vd, ctx->pic, ¶ms);
|
||||||
vd->codec_pts = mp_pts_from_av(ctx->pic->pkt_pts, NULL);
|
vd->codec_pts = mp_pts_from_av(ctx->pic->pkt_pts, NULL);
|
||||||
|
|
Loading…
Reference in New Issue