From 8a1d5e91ade98b8664f873545bb76b3398a6cc08 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 20 Nov 2014 16:48:03 +0100 Subject: 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). --- video/decode/vd_lavc.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- cgit v1.2.3