mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-28 14:29:25 +08:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user