From 60ba7eebd72c16aa4a5c010eb6c046d54877583b Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 23 Aug 2017 14:00:24 +0200 Subject: vd_lavc: fix mid-stream hwdec fallback Not resetting hwdec_request_reinit caused it to flush on every packet, which not only caused it to fail triggering the actual fallback, and let it never decode a new frame, but also to get stuck on EOF. --- video/decode/vd_lavc.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'video') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index e95f2f5c06..8a6a729778 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -557,6 +557,8 @@ static void init_avctx(struct dec_video *vd, const char *decoder, ctx->pix_fmt = AV_PIX_FMT_NONE; ctx->hwdec = hwdec; ctx->hwdec_fmt = 0; + ctx->hwdec_failed = false; + ctx->hwdec_request_reinit = false; ctx->avctx = avcodec_alloc_context3(lavc_codec); AVCodecContext *avctx = ctx->avctx; if (!ctx->avctx) @@ -653,6 +655,7 @@ static void reset_avctx(struct dec_video *vd) if (ctx->avctx && avcodec_is_open(ctx->avctx)) avcodec_flush_buffers(ctx->avctx); ctx->flushing = false; + ctx->hwdec_request_reinit = false; } static void flush_all(struct dec_video *vd) -- cgit v1.2.3