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;
|
||||
AVPacket pkt;
|
||||
|
||||
if (ctx->hwdec_request_reinit)
|
||||
avcodec_flush_buffers(avctx);
|
||||
|
||||
if (flags) {
|
||||
// hr-seek framedrop vs. normal 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;
|
||||
}
|
||||
|
||||
if (ctx->hwdec_request_reinit)
|
||||
avcodec_flush_buffers(avctx);
|
||||
|
||||
// Skipped frame, or delayed output due to multithreaded decoding.
|
||||
if (!got_picture)
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue