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:
Philip Langdale 2015-09-25 08:18:12 -07:00 committed by wm4
parent d2281935b3
commit 361040f9d9
1 changed files with 3 additions and 3 deletions

View File

@ -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;