summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-20 16:48:03 +0100
committerwm4 <wm4@nowhere>2014-11-20 16:48:03 +0100
commit8a1d5e91ade98b8664f873545bb76b3398a6cc08 (patch)
treeb27308cbf985487a9061c22e977eed738c24f9f7 /video
parentcf8efe32351c745903cc3b3bf0b8bc0f33d5cfd5 (diff)
downloadmpv-8a1d5e91ade98b8664f873545bb76b3398a6cc08.tar.bz2
mpv-8a1d5e91ade98b8664f873545bb76b3398a6cc08.tar.xz
vd_lavc: flush frames before uninitializing hw decoder
This way, no surfaces are in use when uninitializing the hw decoders, which might help with -copy hw decoders (normal hw decoding is not affected).
Diffstat (limited to 'video')
-rw-r--r--video/decode/vd_lavc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index 8dfc1a77cd..6132c0d447 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -430,6 +430,9 @@ static void uninit_avctx(struct dec_video *vd)
vd_ffmpeg_ctx *ctx = vd->priv;
AVCodecContext *avctx = ctx->avctx;
+ if (avctx)
+ avcodec_flush_buffers(avctx);
+
if (ctx->hwdec && ctx->hwdec->uninit)
ctx->hwdec->uninit(ctx);