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:
parent
0ab6031d76
commit
50f8548b2f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user