1
mirror of https://github.com/mpv-player/mpv synced 2024-10-30 04:46:41 +01:00

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).
This commit is contained in:
wm4 2014-11-20 16:48:03 +01:00
parent cf8efe3235
commit 8a1d5e91ad

View File

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