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.
This commit is contained in:
wm4 2016-04-26 18:52:14 +02:00
parent 66a958bb4f
commit da59726776
1 changed files with 3 additions and 1 deletions

View File

@ -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)