summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-08-23 14:00:24 +0200
committerwm4 <wm4@nowhere>2017-08-23 14:02:44 +0200
commit60ba7eebd72c16aa4a5c010eb6c046d54877583b (patch)
tree838efc4b855ecaf80cae31eabdfcd50921dea1de /video
parent997e1fb621625da175017e21d6e2d14ab1d0240b (diff)
downloadmpv-60ba7eebd72c16aa4a5c010eb6c046d54877583b.tar.bz2
mpv-60ba7eebd72c16aa4a5c010eb6c046d54877583b.tar.xz
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.
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 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)