From 2912210da18e84620635ecdfde75361fa300f675 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 7 Mar 2017 12:20:04 +0100 Subject: vd_lavc: disable videotoolbox hack with newer ffmpeg versions The hack becomes unnecessary with newer versions, but it's still needed for older ones. --- video/decode/vd_lavc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index a7b05c8a35..fd4bf59092 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -945,8 +945,11 @@ static void handle_err(struct dec_video *vd) if (ctx->hwdec) { ctx->hwdec_fail_count += 1; // The FFmpeg VT hwaccel is buggy and can crash after 1 broken frame. - bool vt = ctx->hwdec && ctx->hwdec->type == HWDEC_VIDEOTOOLBOX; - if (ctx->hwdec_fail_count >= opts->software_fallback || vt) + bool force = false; +#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 82, 101) + force |= ctx->hwdec && ctx->hwdec->type == HWDEC_VIDEOTOOLBOX; +#endif + if (ctx->hwdec_fail_count >= opts->software_fallback || force) ctx->hwdec_failed = true; } } -- cgit v1.2.3