aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bœsch <clement@stupeflix.com>2015-10-15 10:21:52 +0200
committerClément Bœsch <clement@stupeflix.com>2015-10-15 10:22:31 +0200
commit3041618516930d768d0d0a6f5b206e0fcfe0f8f4 (patch)
treeb7a235b3b0065970c4a84f8c4c4d98dc15df7aec
parent9898ef8139ff31d006ae4d976de2b4e648608c51 (diff)
downloadffmpeg-3041618516930d768d0d0a6f5b206e0fcfe0f8f4.tar.gz
ffmpeg/videotoolbox: protect UTGetOSTypeFromString on both VDA and VT
-rw-r--r--ffmpeg_videotoolbox.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ffmpeg_videotoolbox.c b/ffmpeg_videotoolbox.c
index c9355fab05..744a2a0009 100644
--- a/ffmpeg_videotoolbox.c
+++ b/ffmpeg_videotoolbox.c
@@ -157,7 +157,13 @@ int videotoolbox_init(AVCodecContext *s)
CFStringRef pixfmt_str = CFStringCreateWithCString(kCFAllocatorDefault,
videotoolbox_pixfmt,
kCFStringEncodingUTF8);
+#if HAVE_UTGETOSTYPEFROMSTRING
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);
CFRelease(pixfmt_str);
}