diff options
Diffstat (limited to 'video')
-rw-r--r-- | video/decode/vd_lavc.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 109099e382..1982656f75 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -436,12 +436,6 @@ static void uninit_avctx(struct dec_video *vd) vd_ffmpeg_ctx *ctx = vd->priv; AVCodecContext *avctx = ctx->avctx; - if (avctx && avcodec_is_open(avctx)) - avcodec_flush_buffers(avctx); - - if (ctx->hwdec && ctx->hwdec->uninit) - ctx->hwdec->uninit(ctx); - if (avctx) { if (avctx->codec && avcodec_close(avctx) < 0) MP_ERR(vd, "Could not close codec.\n"); @@ -450,6 +444,9 @@ static void uninit_avctx(struct dec_video *vd) av_freep(&avctx->slice_offset); } + if (ctx->hwdec && ctx->hwdec->uninit) + ctx->hwdec->uninit(ctx); + av_freep(&ctx->avctx); av_frame_free(&ctx->pic); |