[vlc-commits] video_filter/ci_filters: Error if necessary colorspace not available

Marvin Scholz git at videolan.org
Tue Sep 26 19:52:35 CEST 2017


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Tue Sep 26 19:48:46 2017 +0200| [d50831fb9c30fa19c85a14e0fb261a3580ae26f1] | committer: Marvin Scholz

video_filter/ci_filters: Error if necessary colorspace not available

kCGColorSpaceITUR_709 was only introduce in 10.11, if this is not
available, error instead of still trying to use it.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d50831fb9c30fa19c85a14e0fb261a3580ae26f1
---

 modules/video_filter/ci_filters.m | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/modules/video_filter/ci_filters.m b/modules/video_filter/ci_filters.m
index bf78edeae2..1e3e884a22 100644
--- a/modules/video_filter/ci_filters.m
+++ b/modules/video_filter/ci_filters.m
@@ -527,6 +527,8 @@ error:
 const CFStringRef kCGColorSpaceITUR_709 = CFSTR("kCGColorSpaceITUR_709");
 #endif
 
+#define OSX_EL_CAPITAN_AND_HIGHER (NSFoundationVersionNumber >= 1252)
+
 static int
 Open(vlc_object_t *obj, char const *psz_filter)
 {
@@ -549,8 +551,15 @@ Open(vlc_object_t *obj, char const *psz_filter)
         if (filter->fmt_in.video.i_chroma != VLC_CODEC_CVPX_NV12
          && filter->fmt_in.video.i_chroma != VLC_CODEC_CVPX_BGRA)
         {
+            if (!OSX_EL_CAPITAN_AND_HIGHER)
+                goto error;
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpartial-availability"
             ctx->color_space =
                 CGColorSpaceCreateWithName(kCGColorSpaceITUR_709);
+#pragma clang diagnostic pop
+
             if (Open_AddConverters(filter, ctx))
                 goto error;
         }



More information about the vlc-commits mailing list