vd_lavc: disable videotoolbox hack with newer ffmpeg versions

The hack becomes unnecessary with newer versions, but it's still needed
for older ones.
This commit is contained in:
wm4 2017-03-07 12:20:04 +01:00
parent 7eb32240c9
commit 2912210da1
1 changed files with 5 additions and 2 deletions

View File

@ -945,8 +945,11 @@ static void handle_err(struct dec_video *vd)
if (ctx->hwdec) { if (ctx->hwdec) {
ctx->hwdec_fail_count += 1; ctx->hwdec_fail_count += 1;
// The FFmpeg VT hwaccel is buggy and can crash after 1 broken frame. // The FFmpeg VT hwaccel is buggy and can crash after 1 broken frame.
bool vt = ctx->hwdec && ctx->hwdec->type == HWDEC_VIDEOTOOLBOX; bool force = false;
if (ctx->hwdec_fail_count >= opts->software_fallback || vt) #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; ctx->hwdec_failed = true;
} }
} }