From da59726776b61d4c8d2e0d358167ffa6d2d49a42 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 26 Apr 2016 18:52:14 +0200 Subject: vd_lavc: hack against videotoolbox crash on failure I guess this won't ever be fixed properly in FFmpeg. Too hairy, and the alternative (using VideoToolbox as "full decoder") is too attractive. --- video/decode/vd_lavc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'video/decode') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index b5679f1b46..45aaa22599 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -762,7 +762,9 @@ static void decode(struct dec_video *vd, struct demux_packet *packet, MP_WARN(vd, "Error while decoding frame!\n"); if (ctx->hwdec) { ctx->hwdec_fail_count += 1; - if (ctx->hwdec_fail_count >= opts->software_fallback) + // 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) ctx->hwdec_failed = true; } if (!ctx->hwdec_failed && packet) -- cgit v1.2.3