summaryrefslogtreecommitdiffstats
path: root/video/decode/vd_lavc.c
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2015-09-25 08:18:12 -0700
committerwm4 <wm4@nowhere>2015-09-25 17:29:44 +0200
commit361040f9d912140832192af78808218d601c7465 (patch)
treeee6b64f9573acc7e8cd2a8426d928d1df19db5ac /video/decode/vd_lavc.c
parentd2281935b36b8fe80824b92e6238dc5e4b4e315a (diff)
downloadmpv-361040f9d912140832192af78808218d601c7465.tar.bz2
mpv-361040f9d912140832192af78808218d601c7465.tar.xz
vd_lavc: Fix recovery from vdpau preemption
Flushing buffers, and thereby triggering decoder reinitialisation needs to happen before attempting, and failing, to decode.
Diffstat (limited to 'video/decode/vd_lavc.c')
-rw-r--r--video/decode/vd_lavc.c6
1 files changed, 3 insertions, 3 deletions
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;