summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-04-26 18:52:14 +0200
committerwm4 <wm4@nowhere>2016-04-26 18:53:58 +0200
commitda59726776b61d4c8d2e0d358167ffa6d2d49a42 (patch)
tree46a31499830f8ac7f9977b4f1af31c7984ddbad4
parent66a958bb4fa43c2fcc7362baed6c85f4f871b00d (diff)
downloadmpv-da59726776b61d4c8d2e0d358167ffa6d2d49a42.tar.bz2
mpv-da59726776b61d4c8d2e0d358167ffa6d2d49a42.tar.xz
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.
-rw-r--r--video/decode/vd_lavc.c4
1 files changed, 3 insertions, 1 deletions
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)