From 361040f9d912140832192af78808218d601c7465 Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Fri, 25 Sep 2015 08:18:12 -0700 Subject: vd_lavc: Fix recovery from vdpau preemption Flushing buffers, and thereby triggering decoder reinitialisation needs to happen before attempting, and failing, to decode. --- video/decode/vd_lavc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'video/decode/vd_lavc.c') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 3d29a9c7d9..1ecd65af6b 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -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; -- cgit v1.2.3