mirror of https://github.com/mpv-player/mpv
vd_lavc: Fix recovery from vdpau preemption
Flushing buffers, and thereby triggering decoder reinitialisation needs to happen before attempting, and failing, to decode.
This commit is contained in:
parent
d2281935b3
commit
361040f9d9
|
@ -612,6 +612,9 @@ static void decode(struct dec_video *vd, struct demux_packet *packet,
|
||||||
struct vd_lavc_params *lavc_param = ctx->opts->vd_lavc_params;
|
struct vd_lavc_params *lavc_param = ctx->opts->vd_lavc_params;
|
||||||
AVPacket pkt;
|
AVPacket pkt;
|
||||||
|
|
||||||
|
if (ctx->hwdec_request_reinit)
|
||||||
|
avcodec_flush_buffers(avctx);
|
||||||
|
|
||||||
if (flags) {
|
if (flags) {
|
||||||
// hr-seek framedrop vs. normal framedrop
|
// hr-seek framedrop vs. normal framedrop
|
||||||
avctx->skip_frame = flags == 2 ? AVDISCARD_NONREF : lavc_param->framedrop;
|
avctx->skip_frame = flags == 2 ? AVDISCARD_NONREF : lavc_param->framedrop;
|
||||||
|
@ -632,9 +635,6 @@ static void decode(struct dec_video *vd, struct demux_packet *packet,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->hwdec_request_reinit)
|
|
||||||
avcodec_flush_buffers(avctx);
|
|
||||||
|
|
||||||
// Skipped frame, or delayed output due to multithreaded decoding.
|
// Skipped frame, or delayed output due to multithreaded decoding.
|
||||||
if (!got_picture)
|
if (!got_picture)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue