[vlc-commits] videotoolbox: fail early on unsupported iOS releases (closes #15085)

Felix Paul Kühne git at videolan.org
Sun Oct 4 18:34:12 CEST 2015


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Oct  4 18:33:12 2015 +0200| [11074cb8258a9b995346d69baaafee50ba56393f] | committer: Felix Paul Kühne

videotoolbox: fail early on unsupported iOS releases (closes #15085)

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

 modules/codec/videotoolbox.m |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 0a8aaee..782d0f4 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -42,6 +42,10 @@
 #import <sys/sysctl.h>
 #import <mach/machine.h>
 
+#if TARGET_OS_IPHONE
+#import <UIKit/UIKit.h>
+#endif
+
 #pragma mark - module descriptor
 
 static int OpenDecoder(vlc_object_t *);
@@ -629,9 +633,16 @@ static void StopVideoToolbox(decoder_t *p_dec)
 static int OpenDecoder(vlc_object_t *p_this)
 {
     decoder_t *p_dec = (decoder_t *)p_this;
-    CMVideoCodecType codec;
+
+#if TARGET_OS_IPHONE
+    if (unlikely([[UIDevice currentDevice].systemVersion floatValue] < 8.0)) {
+        msg_Warn(p_dec, "decoder skipped as OS is too old");
+        return VLC_EGENERIC;
+    }
+#endif
 
     /* check quickly if we can digest the offered data */
+    CMVideoCodecType codec;
     codec = CodecPrecheck(p_dec);
     if (codec == -1)
         return VLC_EGENERIC;



More information about the vlc-commits mailing list