ffmpeg/videotoolbox: protect UTGetOSTypeFromString on both VDA and VT
This commit is contained in:
parent
9898ef8139
commit
3041618516
@ -157,7 +157,13 @@ int videotoolbox_init(AVCodecContext *s)
|
|||||||
CFStringRef pixfmt_str = CFStringCreateWithCString(kCFAllocatorDefault,
|
CFStringRef pixfmt_str = CFStringCreateWithCString(kCFAllocatorDefault,
|
||||||
videotoolbox_pixfmt,
|
videotoolbox_pixfmt,
|
||||||
kCFStringEncodingUTF8);
|
kCFStringEncodingUTF8);
|
||||||
|
#if HAVE_UTGETOSTYPEFROMSTRING
|
||||||
vtctx->cv_pix_fmt_type = UTGetOSTypeFromString(pixfmt_str);
|
vtctx->cv_pix_fmt_type = UTGetOSTypeFromString(pixfmt_str);
|
||||||
|
#else
|
||||||
|
av_log(s, loglevel, "UTGetOSTypeFromString() is not available "
|
||||||
|
"on this platform, %s pixel format can not be honored from "
|
||||||
|
"the command line\n", videotoolbox_pixfmt);
|
||||||
|
#endif
|
||||||
ret = av_videotoolbox_default_init2(s, vtctx);
|
ret = av_videotoolbox_default_init2(s, vtctx);
|
||||||
CFRelease(pixfmt_str);
|
CFRelease(pixfmt_str);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user