Sfoglia il codice sorgente

MVK: rebase patches and update libvlc

Felix Paul Kühne 11 anni fa
parent
commit
86b8eb836b
34 ha cambiato i file con 1025 aggiunte e 35 eliminazioni
  1. 2 2
      MobileVLCKit/patches/0001-Add-secure-transport-TLS-module.patch
  2. 1 1
      MobileVLCKit/patches/0001-arm_neon-added-function-macro-to-handle-the-undersco.patch
  3. 69 0
      MobileVLCKit/patches/0002-arm_neon-added-function-macro-to-handle-the-undersco.patch
  4. 1 1
      MobileVLCKit/patches/0002-arm_neon-use-a-macro-to-fix-compilation-for-iOS.patch
  5. 208 0
      MobileVLCKit/patches/0003-arm_neon-use-a-macro-to-fix-compilation-for-iOS.patch
  6. 1 1
      MobileVLCKit/patches/0003-deinterlace-merge-use-a-macro-to-fix-compilation-for.patch
  7. 1 1
      MobileVLCKit/patches/0004-contrib-ebml-mkv-compile-with-hidden-symbols-on-iOS.patch
  8. 86 0
      MobileVLCKit/patches/0004-deinterlace-merge-use-a-macro-to-fix-compilation-for.patch
  9. 52 0
      MobileVLCKit/patches/0005-contrib-ebml-mkv-compile-with-hidden-symbols-on-iOS.patch
  10. 1 1
      MobileVLCKit/patches/0005-posix-thread-add-a-hack-to-work-around-crashes-when-.patch
  11. 6 6
      MobileVLCKit/patches/0006-freetype-added-a-fake-font-lookup-mechanism-for-iOS-.patch
  12. 36 0
      MobileVLCKit/patches/0006-posix-thread-add-a-hack-to-work-around-crashes-when-.patch
  13. 87 0
      MobileVLCKit/patches/0007-freetype-added-a-fake-font-lookup-mechanism-for-iOS-.patch
  14. 1 1
      MobileVLCKit/patches/0007-libass-fix-text-rendering-on-iOS-by-providing-a-font.patch
  15. 3 3
      MobileVLCKit/patches/0008-freetype-fix-corner-case-crash.patch
  16. 66 0
      MobileVLCKit/patches/0008-libass-fix-text-rendering-on-iOS-by-providing-a-font.patch
  17. 25 0
      MobileVLCKit/patches/0009-freetype-fix-corner-case-crash.patch
  18. 67 0
      MobileVLCKit/patches/0009-io-implement-network-timeout-default-60s.patch
  19. 2 2
      MobileVLCKit/patches/0010-deinterlace-added-a-hack-to-work-around-a-libtool-bu.patch
  20. 2 2
      MobileVLCKit/patches/0011-contrib-png-fix-ARM-assembly-for-iOS.patch
  21. 2 2
      MobileVLCKit/patches/0012-contrib-add-arch-option-for-platforms-where-the-arch.patch
  22. 2 2
      MobileVLCKit/patches/0013-extras-deploy-arch-option-for-iOS.patch
  23. 2 2
      MobileVLCKit/patches/0014-contrib-png-fix-compilation-for-arm64-which-is-unkno.patch
  24. 2 2
      MobileVLCKit/patches/0015-contrib-speex-fix-compilation-for-arm64.patch
  25. 2 2
      MobileVLCKit/patches/0016-contrib-flac-fix-compilation-with-clang-5.0.patch
  26. 2 2
      MobileVLCKit/patches/0017-contrib-gcrypt-use-git-version-on-iOS.patch
  27. 56 0
      MobileVLCKit/patches/0018-gnutls-HACK-to-enable-https-playback-on-iOS.patch
  28. 30 0
      MobileVLCKit/patches/0018-lib-media_player-inherit-deinterlace-and-vbi-variabl.patch
  29. 27 0
      MobileVLCKit/patches/0019-contrib-gnutls-don-t-reconf-on-iOS-so-we-don-t-have-.patch
  30. 57 0
      MobileVLCKit/patches/0020-Revert-gnutls-require-version-3.0.20-or-later.patch
  31. 75 0
      MobileVLCKit/patches/0021-contrib-gnutls-use-version-2.12.23-instead-of-3.1.16.patch
  32. 49 0
      MobileVLCKit/patches/0022-contrib-gcrypt-patch-the-external-API-so-old-gnutls-.patch
  33. 1 1
      MobileVLCKit/patches/0023-lib-media_player-inherit-deinterlace-and-vbi-variabl.patch
  34. 1 1
      buildMobileVLCKit.sh

+ 2 - 2
MobileVLCKit/patches/0001-Add-secure-transport-TLS-module.patch

@@ -1,7 +1,7 @@
-From d9a48c551fc478c8e35dc67bf9efe112c518261f Mon Sep 17 00:00:00 2001
+From 64482a17f5ebbc0fa2945635d236047ebff7016f Mon Sep 17 00:00:00 2001
 From: David Fuhrmann <david.fuhrmann@googlemail.com>
 Date: Tue, 17 Dec 2013 23:03:06 +0100
-Subject: [PATCH 1/2] Add secure transport TLS module
+Subject: [PATCH 01/18] Add secure transport TLS module
 
 Secure Transport is a TLS library part of the Security framework
 (preinstalled on every iOS and MacOS device). This library does

+ 1 - 1
MobileVLCKit/patches/0001-arm_neon-added-function-macro-to-handle-the-undersco.patch

@@ -1,4 +1,4 @@
-From ef776041a5ad68d9819ad3f359a58b14de7af700 Mon Sep 17 00:00:00 2001
+From ce27343baed78b661583b4139cf5107e84871401 Mon Sep 17 00:00:00 2001
 From: David Geldreich <david.geldreich@free.fr>
 Date: Fri, 20 Apr 2012 16:41:19 +0200
 Subject: [PATCH 01/23] arm_neon: added function macro to handle the underscore

+ 69 - 0
MobileVLCKit/patches/0002-arm_neon-added-function-macro-to-handle-the-undersco.patch

@@ -0,0 +1,69 @@
+From 8117aa88c245d291083935a251578c5bb109d0ad Mon Sep 17 00:00:00 2001
+From: David Geldreich <david.geldreich@free.fr>
+Date: Fri, 20 Apr 2012 16:41:19 +0200
+Subject: [PATCH 02/18] arm_neon: added function macro to handle the underscore
+ prefix for the iOS ARM ABI
+
+---
+ modules/arm_neon/asm.S | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 49 insertions(+)
+ create mode 100644 modules/arm_neon/asm.S
+
+diff --git a/modules/arm_neon/asm.S b/modules/arm_neon/asm.S
+new file mode 100644
+index 0000000..d853255
+--- /dev/null
++++ b/modules/arm_neon/asm.S
+@@ -0,0 +1,49 @@
++@*****************************************************************************
++@ asm.S : defines and macros
++@*****************************************************************************
++@ Copyright (C) 2012 David Geldreich <david.geldreich at free.fr>
++@
++@ This program is free software; you can redistribute it and/or modify
++@ it under the terms of the GNU General Public License as published by
++@ the Free Software Foundation; either version 2 of the License, or
++@ (at your option) any later version.
++@
++@ This program is distributed in the hope that it will be useful,
++@ but WITHOUT ANY WARRANTY; without even the implied warranty of
++@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++@ GNU General Public License for more details.
++@
++@ You should have received a copy of the GNU General Public License
++@ along with this program; if not, write to the Free Software Foundation,
++@ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
++@****************************************************************************/
++
++#ifdef __APPLE__
++#   define EXTERN_ASM _
++#else
++#   define EXTERN_ASM
++#endif
++
++#ifdef __ELF__
++#   define ELF
++#else
++#   define ELF @
++#endif
++
++.macro  function name, export=0
++    .macro endfunc
++ELF     .size   \name, . - \name
++        .endfunc
++        .purgem endfunc
++    .endm
++        .text
++        .align          2
++    .if \export
++        .global EXTERN_ASM\name
++EXTERN_ASM\name:
++    .endif
++ELF     .type   \name, %function
++        .func   \name
++\name:
++.endm
++
+-- 
+1.8.3.4 (Apple Git-47)
+

+ 1 - 1
MobileVLCKit/patches/0002-arm_neon-use-a-macro-to-fix-compilation-for-iOS.patch

@@ -1,4 +1,4 @@
-From 7c8852f65771838642d881c287bcc9d7d16daafa Mon Sep 17 00:00:00 2001
+From b714319967e81561f508cf2ff8c53b6a1ebba5af Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Fri, 10 Aug 2012 16:01:49 +0200
 Subject: [PATCH 02/23] arm_neon: use a macro to fix compilation for iOS

+ 208 - 0
MobileVLCKit/patches/0003-arm_neon-use-a-macro-to-fix-compilation-for-iOS.patch

@@ -0,0 +1,208 @@
+From ab21e0bc57d1e92fad355c92a48e8664138ba587 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
+Date: Fri, 10 Aug 2012 16:01:49 +0200
+Subject: [PATCH 03/18] arm_neon: use a macro to fix compilation for iOS
+
+---
+ modules/arm_neon/amplify.S              |  9 +++---
+ modules/arm_neon/simple_channel_mixer.S | 57 +++++++++++++++------------------
+ 2 files changed, 31 insertions(+), 35 deletions(-)
+
+diff --git a/modules/arm_neon/amplify.S b/modules/arm_neon/amplify.S
+index 5938118..578f972 100644
+--- a/modules/arm_neon/amplify.S
++++ b/modules/arm_neon/amplify.S
+@@ -18,6 +18,8 @@
+  @ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+  @****************************************************************************/
+ 
++#include "asm.S"
++
+ 	.syntax	unified
+ 	.arm
+ 	.fpu	neon
+@@ -26,10 +28,8 @@
+ #define	DST	r0
+ #define	SRC	r1
+ #define	SIZE	r2
+-	.align 2
+-	.global amplify_float_arm_neon
+-	.type	amplify_float_arm_neon, %function
+-amplify_float_arm_neon:
++
++function amplify_float_arm_neon, export=1
+ 	cmp		SIZE,	#0
+ 	bxeq		lr
+ #ifdef __ARM_PCS
+@@ -79,3 +79,4 @@ amplify_float_arm_neon:
+ 4:	vst1.f32	{d20-d21},	[DST,:128]!
+ 5:	vst1.f32	{d16-d17},	[DST,:128]!
+ 	bx		lr
++endfunc
+diff --git a/modules/arm_neon/simple_channel_mixer.S b/modules/arm_neon/simple_channel_mixer.S
+index dcc51ed..4722be4 100644
+--- a/modules/arm_neon/simple_channel_mixer.S
++++ b/modules/arm_neon/simple_channel_mixer.S
+@@ -19,6 +19,8 @@
+  @ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+  @****************************************************************************/
+ 
++#include "asm.S"
++
+ 	.fpu neon
+ 	.text
+ 	.align 2
+@@ -34,9 +36,8 @@ coeff_7to2:
+ 	.float 0.5
+ 	.float 0.25
+ 	.float 0.25
+-	.global convert_7to2_neon_asm
+-	.type	convert_7to2_neon_asm, %function
+-convert_7to2_neon_asm:
++
++function convert_7to2_neon_asm, export=1
+ 	push {r4,lr}
+ 
+ 	adr COEFF, coeff_7to2
+@@ -63,16 +64,15 @@ convert_7to2_neon_asm:
+ 	bne 0b
+ 
+ 	pop {r4,pc}
+-
++endfunc
+ 
+ coeff_5to2:
+ 	.float 0.5
+ 	.float 0.5
+ 	.float 0.33
+ 	.float 0.33
+-	.global convert_5to2_neon_asm
+-	.type	convert_5to2_neon_asm, %function
+-convert_5to2_neon_asm:
++
++function convert_5to2_neon_asm, export=1
+ 	push {r4,lr}
+ 
+ 	adr COEFF, coeff_5to2
+@@ -95,14 +95,13 @@ convert_5to2_neon_asm:
+ 	bne 0b
+ 
+ 	pop {r4,pc}
+-
++endfunc
+ 
+ coeff_4to2:
+ 	.float 0.5
+ 	.float 0.5
+-	.global convert_4to2_neon_asm
+-	.type	convert_4to2_neon_asm, %function
+-convert_4to2_neon_asm:
++
++function convert_4to2_neon_asm, export=1
+ 	push {r4,lr}
+ 
+ 	adr COEFF, coeff_4to2
+@@ -119,14 +118,13 @@ convert_4to2_neon_asm:
+ 	bne 0b
+ 
+ 	pop {r4,pc}
+-
++endfunc
+ 
+ coeff_3to2:
+ 	.float 0.5
+ 	.float 0.5
+-	.global convert_3to2_neon_asm
+-	.type	convert_3to2_neon_asm, %function
+-convert_3to2_neon_asm:
++
++function convert_3to2_neon_asm, export=1
+ 	push {r4,lr}
+ 
+ 	adr COEFF, coeff_3to2
+@@ -147,16 +145,15 @@ convert_3to2_neon_asm:
+ 	bne 0b
+ 
+ 	pop {r4,pc}
+-
++endfunc
+ 
+ coeff_7to1:
+ 	.float 0.25
+ 	.float 0.25
+ 	.float 0.125
+ 	.float 0.125
+-	.global convert_7to1_neon_asm
+-	.type	convert_7to1_neon_asm, %function
+-convert_7to1_neon_asm:
++
++function convert_7to1_neon_asm, export=1
+ 	push {r4,lr}
+ 
+ 	adr COEFF, coeff_7to1
+@@ -181,16 +178,15 @@ convert_7to1_neon_asm:
+ 	bne 0b
+ 
+ 	pop {r4,pc}
+-
++endfunc
+ 
+ coeff_5to1:
+ 	.float 0.25
+ 	.float 0.25
+ 	.float 0.16666667
+ 	.float 0.16666667
+-	.global convert_5to1_neon_asm
+-	.type	convert_5to1_neon_asm, %function
+-convert_5to1_neon_asm:
++
++function convert_5to1_neon_asm, export=1
+ 	push {r4,lr}
+ 
+ 	adr COEFF, coeff_5to1
+@@ -212,16 +208,15 @@ convert_5to1_neon_asm:
+ 	bne 0b
+ 
+ 	pop {r4,pc}
+-
++endfunc
+ 
+ coeff_7to4:
+ 	.float 0.5
+ 	.float 0.5
+ 	.float 0.16666667
+ 	.float 0.16666667
+-	.global convert_7to4_neon_asm
+-	.type	convert_7to4_neon_asm, %function
+-convert_7to4_neon_asm:
++
++function convert_7to4_neon_asm, export=1
+ 	push {r4,lr}
+ 
+ 	adr COEFF, coeff_7to4
+@@ -247,14 +242,13 @@ convert_7to4_neon_asm:
+ 	bne 0b
+ 
+ 	pop {r4,pc}
+-
++endfunc
+ 
+ coeff_5to4:
+ 	.float 0.5
+ 	.float 0.5
+-	.global convert_5to4_neon_asm
+-	.type	convert_5to4_neon_asm, %function
+-convert_5to4_neon_asm:
++
++function convert_5to4_neon_asm, export=1
+ 	push {r4,lr}
+ 
+ 	adr COEFF, coeff_5to4
+@@ -277,3 +271,4 @@ convert_5to4_neon_asm:
+ 	bne 0b
+ 
+ 	pop {r4,pc}
++endfunc
+-- 
+1.8.3.4 (Apple Git-47)
+

+ 1 - 1
MobileVLCKit/patches/0003-deinterlace-merge-use-a-macro-to-fix-compilation-for.patch

@@ -1,4 +1,4 @@
-From 7cd23164a4a6edd46a44cc791f016d9b9ea90242 Mon Sep 17 00:00:00 2001
+From 2937a5fd9ea60849a7657897bbe8bafa279832a6 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Fri, 10 Aug 2012 16:02:07 +0200
 Subject: [PATCH 03/23] deinterlace/merge: use a macro to fix compilation for

+ 1 - 1
MobileVLCKit/patches/0004-contrib-ebml-mkv-compile-with-hidden-symbols-on-iOS.patch

@@ -1,4 +1,4 @@
-From f2806506856ea318eeb34da382624979019163c1 Mon Sep 17 00:00:00 2001
+From e3d79b8a4f685c8cf3ae2bc864c90cb0360d48a9 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Sat, 11 Aug 2012 13:29:25 +0200
 Subject: [PATCH 04/23] contrib/ebml+mkv: compile with hidden symbols on iOS

+ 86 - 0
MobileVLCKit/patches/0004-deinterlace-merge-use-a-macro-to-fix-compilation-for.patch

@@ -0,0 +1,86 @@
+From 2cdacf653548fb5fb401b8bf230f92a77c269439 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
+Date: Fri, 10 Aug 2012 16:02:07 +0200
+Subject: [PATCH 04/18] deinterlace/merge: use a macro to fix compilation for
+ iOS
+
+---
+ modules/video_filter/deinterlace/merge_arm.S | 26 ++++++++++----------------
+ 1 file changed, 10 insertions(+), 16 deletions(-)
+
+diff --git a/modules/video_filter/deinterlace/merge_arm.S b/modules/video_filter/deinterlace/merge_arm.S
+index dd77902..03e5042 100644
+--- a/modules/video_filter/deinterlace/merge_arm.S
++++ b/modules/video_filter/deinterlace/merge_arm.S
+@@ -18,6 +18,8 @@
+  @ Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+  @****************************************************************************/
+ 
++#include "../../arm_neon/asm.S"
++
+ 	.syntax	unified
+ 	.arm
+ 	.arch	armv6
+@@ -29,11 +31,8 @@
+ #define	SRC2	r2
+ #define	SIZE	r3
+ 
+-	.align 2
+-	.global merge8_arm_neon
+-	.type	merge8_arm_neon, %function
+ 	@ NOTE: Offset and pitch must be multiple of 16-bytes in VLC.
+-merge8_arm_neon:
++function merge8_arm_neon, export=1
+ 	cmp		SIZE,	#64
+ 	blo		2f
+ 1:
+@@ -70,11 +69,9 @@ merge8_arm_neon:
+ 	vhadd.u8	q0,	q0,	q8
+ 	vst1.u8		{q0},		[DEST,:128]!
+ 	bx		lr
++endfunc
+ 
+-	.align 2
+-	.global merge16_arm_neon
+-	.type	merge16_arm_neon, %function
+-merge16_arm_neon:
++function merge16_arm_neon, export=1
+ 	cmp		SIZE,	#64
+ 	blo		2f
+ 1:
+@@ -111,11 +108,9 @@ merge16_arm_neon:
+ 	vhadd.u16	q0,	q0,	q8
+ 	vst1.u16	{q0},		[DEST,:128]!
+ 	bx		lr
++endfunc
+ 
+-	.align 2
+-	.global merge8_armv6
+-	.type	merge8_armv6, %function
+-merge8_armv6:
++function merge8_armv6, export=1
+ 	push		{r4-r9,lr}
+ 1:
+ 	pld		[SRC1, #64]
+@@ -133,11 +128,9 @@ merge8_armv6:
+ 	stm		DEST!,	{r6-r7}
+ 	popeq		{r4-r9,pc}
+ 	b		1b
++endfunc
+ 
+-	.align 2
+-	.global merge16_armv6
+-	.type	merge16_armv6, %function
+-merge16_armv6:
++function merge16_armv6, export=1
+ 	push		{r4-r9,lr}
+ 1:
+ 	pld		[SRC1, #64]
+@@ -155,3 +148,4 @@ merge16_armv6:
+ 	stm		DEST!,	{r6-r7}
+ 	popeq		{r4-r9,pc}
+ 	b		1b
++endfunc
+-- 
+1.8.3.4 (Apple Git-47)
+

+ 52 - 0
MobileVLCKit/patches/0005-contrib-ebml-mkv-compile-with-hidden-symbols-on-iOS.patch

@@ -0,0 +1,52 @@
+From 8d29c02c05507c2181bdc5c477a5f8a94b4aa140 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
+Date: Sat, 11 Aug 2012 13:29:25 +0200
+Subject: [PATCH 05/18] contrib/ebml+mkv: compile with hidden symbols on iOS
+
+---
+ contrib/src/ebml/rules.mak     | 7 +++++--
+ contrib/src/matroska/rules.mak | 6 +++++-
+ 2 files changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/contrib/src/ebml/rules.mak b/contrib/src/ebml/rules.mak
+index 1d01818..a36727c 100644
+--- a/contrib/src/ebml/rules.mak
++++ b/contrib/src/ebml/rules.mak
+@@ -16,8 +16,11 @@ libebml: libebml-$(EBML_VERSION).tar.bz2 .sum-ebml
+ 	$(MOVE)
+ 
+ # libebml requires exceptions
+-EBML_EXTRA_FLAGS = CXXFLAGS="${CXXFLAGS} -fexceptions" \
+-					CPPFLAGS=""
++ifdef HAVE_IOS
++EBML_EXTRA_FLAGS = CXXFLAGS="${CXXFLAGS} -fexceptions -fvisibility=hidden" CPPFLAGS=""
++else
++EBML_EXTRA_FLAGS = CXXFLAGS="${CXXFLAGS} -fexceptions" CPPFLAGS=""
++endif
+ 
+ .ebml: libebml
+ ifdef HAVE_WIN32
+diff --git a/contrib/src/matroska/rules.mak b/contrib/src/matroska/rules.mak
+index 336e001..40dfb1e 100644
+--- a/contrib/src/matroska/rules.mak
++++ b/contrib/src/matroska/rules.mak
+@@ -17,11 +17,15 @@ libmatroska: libmatroska-$(MATROSKA_VERSION).tar.bz2 .sum-matroska
+ 	$(APPLY) $(SRC)/matroska/matroska-pic.patch
+ 	$(MOVE)
+ 
++ifdef HAVE_IOS
++MATROSKA_EXTRA_FLAGS = CXXFLAGS="${CXXFLAGS} -fvisibility=hidden"
++endif
++
+ .matroska: libmatroska
+ ifdef HAVE_WIN32
+ 	cd $< && $(MAKE) -C make/mingw32 prefix="$(PREFIX)" $(HOSTVARS) SHARED=no EBML_DLL=no libmatroska.a
+ else
+-	cd $< && $(MAKE) -C make/linux prefix="$(PREFIX)" $(HOSTVARS) staticlib
++	cd $< && $(MAKE) -C make/linux prefix="$(PREFIX)" $(HOSTVARS) $(MATROSKA_EXTRA_FLAGS) staticlib
+ endif
+ 	cd $< && $(MAKE) -C make/linux install_staticlib install_headers prefix="$(PREFIX)" $(HOSTVARS)
+ 	$(RANLIB) "$(PREFIX)/lib/libmatroska.a"
+-- 
+1.8.3.4 (Apple Git-47)
+

+ 1 - 1
MobileVLCKit/patches/0005-posix-thread-add-a-hack-to-work-around-crashes-when-.patch

@@ -1,4 +1,4 @@
-From 254074a4594fdbaf040b1c8a30a4fde6540adb4a Mon Sep 17 00:00:00 2001
+From 3328f06b081f63e17e7a97c989286c0dda14003f Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Thu, 18 Oct 2012 18:38:17 +0200
 Subject: [PATCH 05/23] posix/thread: add a hack to work-around crashes when

+ 6 - 6
MobileVLCKit/patches/0006-freetype-added-a-fake-font-lookup-mechanism-for-iOS-.patch

@@ -1,4 +1,4 @@
-From b68a05f395c859ff8c25d2ccf6d9d55086ea556f Mon Sep 17 00:00:00 2001
+From 9c951054886ec558da8e947c1a0914aad8a74336 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Fri, 19 Jul 2013 18:38:41 +0700
 Subject: [PATCH 06/23] freetype: added a fake font lookup mechanism for iOS to
@@ -9,10 +9,10 @@ Subject: [PATCH 06/23] freetype: added a fake font lookup mechanism for iOS to
  1 file changed, 42 insertions(+)
 
 diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
-index c27ec45..93beba8 100644
+index 25d6b15..dbeb0f1 100644
 --- a/modules/text_renderer/freetype.c
 +++ b/modules/text_renderer/freetype.c
-@@ -107,6 +107,9 @@
+@@ -106,6 +106,9 @@
  #include <TargetConditionals.h>
  #if !TARGET_OS_IPHONE
  #include <Carbon/Carbon.h>
@@ -22,7 +22,7 @@ index c27ec45..93beba8 100644
  #endif
  #include <sys/param.h>                         /* for MAXPATHLEN */
  #undef HAVE_FONTCONFIG
-@@ -808,6 +811,40 @@ static char* MacLegacy_Select( filter_t *p_filter, const char* psz_fontname,
+@@ -807,6 +810,40 @@ static char* MacLegacy_Select( filter_t *p_filter, const char* psz_fontname,
  
      return psz_path;
  }
@@ -63,7 +63,7 @@ index c27ec45..93beba8 100644
  #endif
  #endif
  
-@@ -1989,6 +2026,8 @@ static FT_Face LoadFace( filter_t *p_filter,
+@@ -1988,6 +2025,8 @@ static FT_Face LoadFace( filter_t *p_filter,
  #elif defined( __APPLE__ )
  #if !TARGET_OS_IPHONE
          psz_fontfile = MacLegacy_Select( p_filter, p_style->psz_fontname, false, false, -1, &i_idx );
@@ -72,7 +72,7 @@ index c27ec45..93beba8 100644
  #endif
  #elif defined( _WIN32 )
          psz_fontfile = Win32_Select( p_filter,
-@@ -2895,6 +2934,9 @@ static int Create( vlc_object_t *p_this )
+@@ -2894,6 +2933,9 @@ static int Create( vlc_object_t *p_this )
  #elif defined(__APPLE__)
  #if !TARGET_OS_IPHONE
      psz_fontfile = MacLegacy_Select( p_filter, psz_fontfamily, false, false, 0, &fontindex );

+ 36 - 0
MobileVLCKit/patches/0006-posix-thread-add-a-hack-to-work-around-crashes-when-.patch

@@ -0,0 +1,36 @@
+From a07f4a447e56ea6e459c5503a73b87eb8897e9dd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
+Date: Thu, 18 Oct 2012 18:38:17 +0200
+Subject: [PATCH 06/18] posix/thread: add a hack to work-around crashes when
+ using the buggy iOS 6 runtime
+
+---
+ src/posix/thread.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/src/posix/thread.c b/src/posix/thread.c
+index 514f592..6a95bb0 100644
+--- a/src/posix/thread.c
++++ b/src/posix/thread.c
+@@ -355,6 +355,18 @@ void vlc_cond_init_daytime (vlc_cond_t *p_condvar)
+ void vlc_cond_destroy (vlc_cond_t *p_condvar)
+ {
+     int val = pthread_cond_destroy( p_condvar );
++
++#ifdef __APPLE__
++    if (val != 0) {
++        printf("pthread_cond_destroy returned %i\n", val);
++
++        if (val == EBUSY) {
++            printf("this is a EBUSY!\n");
++            return;
++        }
++    }
++#endif
++
+     VLC_THREAD_ASSERT ("destroying condition");
+ }
+ 
+-- 
+1.8.3.4 (Apple Git-47)
+

+ 87 - 0
MobileVLCKit/patches/0007-freetype-added-a-fake-font-lookup-mechanism-for-iOS-.patch

@@ -0,0 +1,87 @@
+From 54f927c0d90cfa26ff4b92a35fcadfee87e3d45c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
+Date: Fri, 19 Jul 2013 18:38:41 +0700
+Subject: [PATCH 07/18] freetype: added a fake font lookup mechanism for iOS to
+ use the packaged demo fonts
+
+---
+ modules/text_renderer/freetype.c | 42 ++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 42 insertions(+)
+
+diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
+index c27ec45..93beba8 100644
+--- a/modules/text_renderer/freetype.c
++++ b/modules/text_renderer/freetype.c
+@@ -107,6 +107,9 @@
+ #include <TargetConditionals.h>
+ #if !TARGET_OS_IPHONE
+ #include <Carbon/Carbon.h>
++#else
++#include <CoreFoundation/CoreFoundation.h>
++#include <vlc_url.h>
+ #endif
+ #include <sys/param.h>                         /* for MAXPATHLEN */
+ #undef HAVE_FONTCONFIG
+@@ -808,6 +811,40 @@ static char* MacLegacy_Select( filter_t *p_filter, const char* psz_fontname,
+ 
+     return psz_path;
+ }
++#else
++static char *iOSFake_Select( filter_t *p_filter, bool b_monospace, bool b_bold,
++                             bool b_italic )
++{
++    // included for future implementation
++    VLC_UNUSED(p_filter);
++    VLC_UNUSED(b_bold);
++    VLC_UNUSED(b_italic);
++    VLC_UNUSED(b_monospace);
++
++    CFURLRef fileURL;
++    fileURL = CFBundleCopyResourceURL(CFBundleGetMainBundle(), b_monospace ?
++                                      CFSTR("OpenSans-Regular.ttf") : CFSTR("SourceCodePro-Regular.ttf"),
++                                      NULL,
++                                      NULL);
++    CFStringRef urlString = CFURLCopyFileSystemPath(fileURL, kCFURLPOSIXPathStyle);
++    CFRelease(fileURL);
++
++    if (!urlString)
++        return NULL;
++
++    CFIndex length = CFStringGetLength(urlString);
++    if (!length)
++        return NULL;
++    length++;
++
++    char *psz_path = (char *)malloc(length);
++    CFStringGetCString(urlString, psz_path, length, kCFStringEncodingUTF8);
++    CFRelease(urlString);
++
++    psz_path = strdup(psz_path);
++
++    return psz_path;
++}
+ #endif
+ #endif
+ 
+@@ -1989,6 +2026,8 @@ static FT_Face LoadFace( filter_t *p_filter,
+ #elif defined( __APPLE__ )
+ #if !TARGET_OS_IPHONE
+         psz_fontfile = MacLegacy_Select( p_filter, p_style->psz_fontname, false, false, -1, &i_idx );
++#else
++        psz_fontfile = iOSFake_Select( p_filter, false, false, false );
+ #endif
+ #elif defined( _WIN32 )
+         psz_fontfile = Win32_Select( p_filter,
+@@ -2895,6 +2934,9 @@ static int Create( vlc_object_t *p_this )
+ #elif defined(__APPLE__)
+ #if !TARGET_OS_IPHONE
+     psz_fontfile = MacLegacy_Select( p_filter, psz_fontfamily, false, false, 0, &fontindex );
++#else
++    psz_fontfile = iOSFake_Select( p_filter, false, false, false );
++    psz_monofontfile = iOSFake_Select( p_filter, true, false, false );
+ #endif
+ #elif defined(_WIN32)
+     psz_fontfile = Win32_Select( p_filter, psz_fontfamily, false, false,
+-- 
+1.8.3.4 (Apple Git-47)
+

+ 1 - 1
MobileVLCKit/patches/0007-libass-fix-text-rendering-on-iOS-by-providing-a-font.patch

@@ -1,4 +1,4 @@
-From c9feb6cf01b6470f6f3be7972d3839f34c5d21aa Mon Sep 17 00:00:00 2001
+From e33c1c87ee0baebd8a8c4bed719a059ae7127647 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Wed, 29 May 2013 13:25:54 +0200
 Subject: [PATCH 07/23] libass: fix text rendering on iOS by providing a font

+ 3 - 3
MobileVLCKit/patches/0008-freetype-fix-corner-case-crash.patch

@@ -1,4 +1,4 @@
-From 4ddaf9d4298756544f02587b8db2a190d44b5388 Mon Sep 17 00:00:00 2001
+From 314b39d85b64776346f3cb005a183ffba7c11781 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Sun, 21 Jul 2013 18:18:33 +0200
 Subject: [PATCH 08/23] freetype: fix corner-case crash
@@ -8,10 +8,10 @@ Subject: [PATCH 08/23] freetype: fix corner-case crash
  1 file changed, 2 insertions(+)
 
 diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
-index 93beba8..4bac64d 100644
+index dbeb0f1..84799d7 100644
 --- a/modules/text_renderer/freetype.c
 +++ b/modules/text_renderer/freetype.c
-@@ -826,6 +826,8 @@ static char *iOSFake_Select( filter_t *p_filter, bool b_monospace, bool b_bold,
+@@ -825,6 +825,8 @@ static char *iOSFake_Select( filter_t *p_filter, bool b_monospace, bool b_bold,
                                        CFSTR("OpenSans-Regular.ttf") : CFSTR("SourceCodePro-Regular.ttf"),
                                        NULL,
                                        NULL);

+ 66 - 0
MobileVLCKit/patches/0008-libass-fix-text-rendering-on-iOS-by-providing-a-font.patch

@@ -0,0 +1,66 @@
+From 3d2cbaf8b17f1e7d526883d1529fcab0f5d06139 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
+Date: Wed, 29 May 2013 13:25:54 +0200
+Subject: [PATCH 08/18] libass: fix text rendering on iOS by providing a font
+ lookup mechanism for the font shipped with Aspen
+
+---
+ modules/codec/libass.c | 35 +++++++++++++++++++++++++++++++++++
+ 1 file changed, 35 insertions(+)
+
+diff --git a/modules/codec/libass.c b/modules/codec/libass.c
+index aa38f1b..38961bc 100644
+--- a/modules/codec/libass.c
++++ b/modules/codec/libass.c
+@@ -29,6 +29,13 @@
+ #   include "config.h"
+ #endif
+ 
++#if defined (__APPLE__)
++#include <TargetConditionals.h>
++#if TARGET_OS_IPHONE
++#include <CoreFoundation/CoreFoundation.h>
++#endif
++#endif
++
+ #include <string.h>
+ #include <limits.h>
+ #include <assert.h>
+@@ -213,6 +220,34 @@ static int Create( vlc_object_t *p_this )
+ #if defined( __ANDROID__ )
+     const char *psz_font = "/system/fonts/DroidSans-Bold.ttf";
+     const char *psz_family = "Droid Sans Bold";
++#elif defined (__APPLE__)
++#if !TARGET_OS_IPHONE
++    const char *psz_font = NULL; /* We don't ship a default font with VLC */
++    const char *psz_family = "Arial"; /* Use Arial if we can't find anything more suitable */
++#else
++    CFURLRef fileURL;
++    fileURL = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("OpenSans-Regular.ttf"),
++                                      NULL,
++                                      NULL);
++    CFStringRef urlString = CFURLCopyFileSystemPath(fileURL, kCFURLPOSIXPathStyle);
++    CFRelease(fileURL);
++
++    if (!urlString)
++        return VLC_EGENERIC;
++
++    CFIndex length = CFStringGetLength(urlString);
++    if (!length)
++        return VLC_EGENERIC;
++    length++;
++
++    char *psz_path = (char *)malloc(length);
++    CFStringGetCString(urlString, psz_path, length, kCFStringEncodingUTF8);
++    CFRelease(urlString);
++
++    const char *psz_font = (const char *)strdup(psz_path);
++    free(psz_path);
++    const char *psz_family = "Open Sans";
++#endif
+ #else
+     const char *psz_font = NULL; /* We don't ship a default font with VLC */
+     const char *psz_family = "Arial"; /* Use Arial if we can't find anything more suitable */
+-- 
+1.8.3.4 (Apple Git-47)
+

+ 25 - 0
MobileVLCKit/patches/0009-freetype-fix-corner-case-crash.patch

@@ -0,0 +1,25 @@
+From 4a3b920ee5f164528143cffabbfb854d272371e4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
+Date: Sun, 21 Jul 2013 18:18:33 +0200
+Subject: [PATCH 09/18] freetype: fix corner-case crash
+
+---
+ modules/text_renderer/freetype.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/modules/text_renderer/freetype.c b/modules/text_renderer/freetype.c
+index 93beba8..4bac64d 100644
+--- a/modules/text_renderer/freetype.c
++++ b/modules/text_renderer/freetype.c
+@@ -826,6 +826,8 @@ static char *iOSFake_Select( filter_t *p_filter, bool b_monospace, bool b_bold,
+                                       CFSTR("OpenSans-Regular.ttf") : CFSTR("SourceCodePro-Regular.ttf"),
+                                       NULL,
+                                       NULL);
++    if (!fileURL)
++        return NULL;
+     CFStringRef urlString = CFURLCopyFileSystemPath(fileURL, kCFURLPOSIXPathStyle);
+     CFRelease(fileURL);
+ 
+-- 
+1.8.3.4 (Apple Git-47)
+

+ 67 - 0
MobileVLCKit/patches/0009-io-implement-network-timeout-default-60s.patch

@@ -0,0 +1,67 @@
+From 7140ae0b34c18345f203e742fa91349ac22ed7d6 Mon Sep 17 00:00:00 2001
+From: Gleb Pinigin <gpinigin@gmail.com>
+Date: Sun, 28 Jul 2013 18:32:51 +0700
+Subject: [PATCH 09/23] io: implement network timeout(default 60s)
+
+---
+ src/network/io.c | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/src/network/io.c b/src/network/io.c
+index dc5ef12..effaf15 100644
+--- a/src/network/io.c
++++ b/src/network/io.c
+@@ -33,6 +33,7 @@
+ #endif
+ 
+ #include <vlc_common.h>
++#include <vlc_access.h>
+ 
+ #include <stdlib.h>
+ #include <stdio.h>
+@@ -73,6 +74,9 @@
+ # define SOL_DCCP 269
+ #endif
+ 
++#define MAX_TIMEOUT 60000
++#define POLL_TIMEOUT 10000
++
+ #include "libvlc.h" /* vlc_object_waitpipe */
+ 
+ extern int rootwrap_bind (int family, int socktype, int protocol,
+@@ -267,6 +271,7 @@ net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs,
+     ufd[1].fd = vlc_object_waitpipe (p_this);
+     ufd[1].events = POLLIN;
+ 
++    int i_timepassed = 0;
+     size_t i_total = 0;
+     do
+     {
+@@ -288,6 +293,13 @@ net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs,
+ 
+         if (n < 0)
+         {
++            if (i_timepassed >= MAX_TIMEOUT && i_total == 0)
++            {
++                access_t *p_access = (access_t *)p_this;
++                p_access->info.b_eof = true;
++                goto error;
++            }
++
+             switch (net_errno)
+             {
+                 case EAGAIN: /* no data */
+@@ -326,8 +338,9 @@ net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs,
+             return -1;
+         }
+ 
++        i_timepassed += POLL_TIMEOUT;
+         /* Wait for more data */
+-        if (poll (ufd, sizeof (ufd) / sizeof (ufd[0]), -1) < 0)
++        if (poll (ufd, sizeof (ufd) / sizeof (ufd[0]), POLL_TIMEOUT) < 0)
+         {
+             if (errno == EINTR)
+                 continue;
+-- 
+1.8.3.4 (Apple Git-47)
+

+ 2 - 2
MobileVLCKit/patches/0010-deinterlace-added-a-hack-to-work-around-a-libtool-bu.patch

@@ -1,7 +1,7 @@
-From d07fd68c1f19f71fb4a37e9ec5c4e827b4a43f5b Mon Sep 17 00:00:00 2001
+From c2145ffd6b949d2e101c9cfed42f22b94d20cd97 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Fri, 10 Aug 2012 16:02:33 +0200
-Subject: [PATCH 10/23] deinterlace: added a hack to work-around a libtool bug
+Subject: [PATCH 10/18] deinterlace: added a hack to work-around a libtool bug
 
 ---
  modules/video_filter/Modules.am | 4 ++++

+ 2 - 2
MobileVLCKit/patches/0011-contrib-png-fix-ARM-assembly-for-iOS.patch

@@ -1,7 +1,7 @@
-From 7f0a2cc704998de73f892a2304a313b2c7220823 Mon Sep 17 00:00:00 2001
+From 6ed3110b140d3de05a307f1c90896cdae8e8dc72 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20Ku=CC=88hne?= <fkuehne@videolan.org>
 Date: Sat, 20 Jul 2013 23:35:05 +0200
-Subject: [PATCH 11/23] contrib/png: fix ARM assembly for iOS
+Subject: [PATCH 11/18] contrib/png: fix ARM assembly for iOS
 
 ---
  contrib/src/png/ios.patch | 66 +++++++++++++++++++++++++++++++++++++++++++++++

+ 2 - 2
MobileVLCKit/patches/0012-contrib-add-arch-option-for-platforms-where-the-arch.patch

@@ -1,7 +1,7 @@
-From 5015458b755e7ab7d50c683a01da194c71eb8479 Mon Sep 17 00:00:00 2001
+From 0bd87b03acb8bdec0f049ea881db144cfa471b42 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Thu, 3 Oct 2013 18:27:43 +0200
-Subject: [PATCH 12/23] contrib: add arch option for platforms where the arch
+Subject: [PATCH 12/18] contrib: add arch option for platforms where the arch
  triplet would be ambigous
 
 ---

+ 2 - 2
MobileVLCKit/patches/0013-extras-deploy-arch-option-for-iOS.patch

@@ -1,7 +1,7 @@
-From 3cb5e1a73d8aef941efb09f3f49f1ce72e8e269a Mon Sep 17 00:00:00 2001
+From 87a452b8817c149ed5cb3367b33cfc2d46c675df Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Thu, 3 Oct 2013 18:28:26 +0200
-Subject: [PATCH 13/23] extras: deploy arch option for iOS
+Subject: [PATCH 13/18] extras: deploy arch option for iOS
 
 ---
  extras/package/ios/build.sh | 2 +-

+ 2 - 2
MobileVLCKit/patches/0014-contrib-png-fix-compilation-for-arm64-which-is-unkno.patch

@@ -1,7 +1,7 @@
-From d9a5a3394c366a8af0d80c1e6e2e1b9931a6e6ba Mon Sep 17 00:00:00 2001
+From 86c9372f3014405ea0e095b10bca8e2fc6603d90 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Thu, 3 Oct 2013 18:38:25 +0200
-Subject: [PATCH 14/23] contrib/png: fix compilation for arm64 which is unknown
+Subject: [PATCH 14/18] contrib/png: fix compilation for arm64 which is unknown
  to the libpng developers
 
 ---

+ 2 - 2
MobileVLCKit/patches/0015-contrib-speex-fix-compilation-for-arm64.patch

@@ -1,7 +1,7 @@
-From 5a36158793a16d02ced092dd96d3c56269c1754a Mon Sep 17 00:00:00 2001
+From 431dd60c4a7e9bf2278eeaed4f8cbeb3fb79878d Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Thu, 3 Oct 2013 19:30:01 +0200
-Subject: [PATCH 15/23] contrib/speex: fix compilation for arm64
+Subject: [PATCH 15/18] contrib/speex: fix compilation for arm64
 
 ---
  contrib/src/speex/rules.mak | 5 +++++

+ 2 - 2
MobileVLCKit/patches/0016-contrib-flac-fix-compilation-with-clang-5.0.patch

@@ -1,7 +1,7 @@
-From 76b1dc709f57a206c54212d33298d2a5156da114 Mon Sep 17 00:00:00 2001
+From e328be72442e31d54c894ebb2a6ab808413432b4 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Mon, 7 Oct 2013 17:05:21 +0200
-Subject: [PATCH 16/23] contrib/flac: fix compilation with clang 5.0
+Subject: [PATCH 16/18] contrib/flac: fix compilation with clang 5.0
 
 ---
  contrib/src/flac/libFLAC-clang-5.0.patch | 19 +++++++++++++++++++

+ 2 - 2
MobileVLCKit/patches/0017-contrib-gcrypt-use-git-version-on-iOS.patch

@@ -1,7 +1,7 @@
-From 5397b09b17580f1d10d855f91a4bb8c51de4a570 Mon Sep 17 00:00:00 2001
+From 1678ea007563ab91e31f31bf6beb0e8b7a6312c3 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Thu, 31 Oct 2013 20:42:59 +0100
-Subject: [PATCH 17/23] contrib/gcrypt: use git version on iOS
+Subject: [PATCH 17/18] contrib/gcrypt: use git version on iOS
 
 ---
  contrib/src/gcrypt/disable-doc-compilation.patch   | 43 ++++++++++++++++++++++

+ 56 - 0
MobileVLCKit/patches/0018-gnutls-HACK-to-enable-https-playback-on-iOS.patch

@@ -0,0 +1,56 @@
+From f13b5eaafd9d4d4e22bddeabd22ef8cef2481261 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
+Date: Tue, 19 Nov 2013 00:09:34 +0100
+Subject: [PATCH 18/23] gnutls: HACK to enable https playback on iOS
+
+Note that certificates presented by a server won't verified at all so we cannot trust the stream
+---
+ modules/misc/gnutls.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/modules/misc/gnutls.c b/modules/misc/gnutls.c
+index 4a6056a..1d70ea5 100644
+--- a/modules/misc/gnutls.c
++++ b/modules/misc/gnutls.c
+@@ -40,6 +40,10 @@
+ #include <gnutls/x509.h>
+ #include "dhparams.h"
+ 
++#if defined (__APPLE__)
++#include <TargetConditionals.h>
++#endif
++
+ /*****************************************************************************
+  * Module descriptor
+  *****************************************************************************/
+@@ -291,9 +295,11 @@ static int gnutls_CertSearch (vlc_tls_t *obj, const char *host,
+             return -1;
+     }
+ 
++#if !TARGET_OS_IPHONE
+     if (dialog_Question (obj, _("Insecure site"), vlc_gettext (msg),
+                          _("Abort"), _("View certificate"), NULL, host) != 2)
+         return -1;
++#endif
+ 
+     gnutls_x509_crt_t cert;
+     gnutls_datum_t desc;
+@@ -308,11 +314,15 @@ static int gnutls_CertSearch (vlc_tls_t *obj, const char *host,
+     }
+     gnutls_x509_crt_deinit (cert);
+ 
++#if !TARGET_OS_IPHONE
+     val = dialog_Question (obj, _("Insecure site"),
+          _("This is the certificate presented by %s:\n%s\n\n"
+            "If in doubt, abort now.\n"),
+                            _("Abort"), _("Accept 24 hours"),
+                            _("Accept permanently"), host, desc.data);
++#else
++    val = 2;
++#endif
+     gnutls_free (desc.data);
+ 
+     time_t expiry = 0;
+-- 
+1.8.3.4 (Apple Git-47)
+

+ 30 - 0
MobileVLCKit/patches/0018-lib-media_player-inherit-deinterlace-and-vbi-variabl.patch

@@ -0,0 +1,30 @@
+From a9249b92ecc4eeb1abe16c9f17e7023c3bea8299 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
+Date: Thu, 21 Nov 2013 16:26:40 +0100
+Subject: [PATCH 18/18] lib/media_player: inherit deinterlace and vbi variables
+ to fix correct variables values on first use
+
+---
+ lib/media_player.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/media_player.c b/lib/media_player.c
+index 01ab243..064691f 100644
+--- a/lib/media_player.c
++++ b/lib/media_player.c
+@@ -410,10 +410,10 @@ libvlc_media_player_new( libvlc_instance_t *instance )
+     var_SetFloat (mp, "scale", 1.);
+     var_Create (mp, "aspect-ratio", VLC_VAR_STRING);
+     var_Create (mp, "crop", VLC_VAR_STRING);
+-    var_Create (mp, "deinterlace", VLC_VAR_INTEGER);
++    var_Create (mp, "deinterlace", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
+     var_Create (mp, "deinterlace-mode", VLC_VAR_STRING);
+ 
+-    var_Create (mp, "vbi-page", VLC_VAR_INTEGER);
++    var_Create (mp, "vbi-page", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
+ 
+     var_Create (mp, "marq-marquee", VLC_VAR_STRING);
+     var_Create (mp, "marq-color", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
+-- 
+1.8.3.4 (Apple Git-47)
+

+ 27 - 0
MobileVLCKit/patches/0019-contrib-gnutls-don-t-reconf-on-iOS-so-we-don-t-have-.patch

@@ -0,0 +1,27 @@
+From bb301a1254e0fd72aa013c98facc21b1232ea261 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
+Date: Tue, 19 Nov 2013 16:56:24 +0100
+Subject: [PATCH 19/23] contrib/gnutls: don't reconf on iOS so we don't have to
+ compile gettext
+
+---
+ contrib/src/gnutls/rules.mak | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/contrib/src/gnutls/rules.mak b/contrib/src/gnutls/rules.mak
+index b587686..7d997d8 100644
+--- a/contrib/src/gnutls/rules.mak
++++ b/contrib/src/gnutls/rules.mak
+@@ -48,7 +48,9 @@ GNUTLS_CONF := \
+ DEPS_gnutls = nettle $(DEPS_nettle)
+ 
+ .gnutls: gnutls
++ifndef HAVE_IOS
+ 	$(RECONF)
++endif
+ ifdef HAVE_ANDROID
+ 	cd $< && $(HOSTVARS) gl_cv_header_working_stdint_h=yes ./configure $(GNUTLS_CONF)
+ else
+-- 
+1.8.3.4 (Apple Git-47)
+

+ 57 - 0
MobileVLCKit/patches/0020-Revert-gnutls-require-version-3.0.20-or-later.patch

@@ -0,0 +1,57 @@
+From 9c5ba5c18effb3f15970e8d04b53664dd1071b90 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
+Date: Thu, 21 Nov 2013 01:35:43 +0100
+Subject: [PATCH 20/23] Revert "gnutls: require version 3.0.20 or later"
+
+This reverts commit 55f8f754788a0ad228f53ea40706710b517e5f2a.
+---
+ configure.ac          |  2 +-
+ modules/misc/gnutls.c | 12 +++++++++++-
+ 2 files changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 02fb8aa..98ba0c4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3969,7 +3969,7 @@ dnl
+ AC_ARG_ENABLE(gnutls,
+   [  --enable-gnutls         GNU TLS TLS/SSL support (default enabled)])
+ AS_IF([test "${enable_gnutls}" != "no"], [
+-  PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.0.20], [
++  PKG_CHECK_MODULES(GNUTLS, [gnutls >= 2.6.6], [
+     VLC_ADD_PLUGIN([gnutls])
+   ], [
+     AS_IF([test -n "${enable_gnutls}"], [
+diff --git a/modules/misc/gnutls.c b/modules/misc/gnutls.c
+index 1d70ea5..6630af1 100644
+--- a/modules/misc/gnutls.c
++++ b/modules/misc/gnutls.c
+@@ -38,6 +38,16 @@
+ 
+ #include <gnutls/gnutls.h>
+ #include <gnutls/x509.h>
++#if (GNUTLS_VERSION_NUMBER < 0x030014)
++# define gnutls_certificate_set_x509_system_trust(c) \
++    (c, GNUTLS_E_UNIMPLEMENTED_FEATURE)
++#endif
++#if (GNUTLS_VERSION_NUMBER < 0x03000D)
++# define gnutls_verify_stored_pubkey(db,tdb,host,serv,ctype,cert,fl) \
++    (db, host, serv, ctype, cert, fl, GNUTLS_E_NO_CERTIFICATE_FOUND)
++# define gnutls_store_pubkey(db,tdb,host,serv,ctype,cert,e,fl) \
++    (db, host, serv, ctype, cert, fl, GNUTLS_E_UNIMPLEMENTED_FEATURE)
++#endif
+ #include "dhparams.h"
+ 
+ #if defined (__APPLE__)
+@@ -108,7 +118,7 @@ static int gnutls_Init (vlc_object_t *p_this)
+         goto error;
+     }
+ 
+-    const char *psz_version = gnutls_check_version ("3.0.20");
++    const char *psz_version = gnutls_check_version ("2.6.6");
+     if (psz_version == NULL)
+     {
+         msg_Err (p_this, "unsupported GnuTLS version");
+-- 
+1.8.3.4 (Apple Git-47)
+

+ 75 - 0
MobileVLCKit/patches/0021-contrib-gnutls-use-version-2.12.23-instead-of-3.1.16.patch

@@ -0,0 +1,75 @@
+From 71ef71b36dcb05ec12b027d1bfa27ad3df45dffc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
+Date: Thu, 21 Nov 2013 02:36:43 +0100
+Subject: [PATCH 21/23] contrib/gnutls: use version 2.12.23 instead of 3.1.16
+ which still depends on gcrypt instead of nettle
+
+---
+ contrib/src/gnutls/SHA512SUMS |  2 +-
+ contrib/src/gnutls/rules.mak  | 25 +++++++------------------
+ 2 files changed, 8 insertions(+), 19 deletions(-)
+
+diff --git a/contrib/src/gnutls/SHA512SUMS b/contrib/src/gnutls/SHA512SUMS
+index 72a6ed1..098d2ae 100644
+--- a/contrib/src/gnutls/SHA512SUMS
++++ b/contrib/src/gnutls/SHA512SUMS
+@@ -1 +1 @@
+-dfd1fa108877994c7b2c7c127aea9267c8d78145c0902fbe4b19131fb77bb454e96e3b65af66b8e98596d601cfb07abb8966e5882533002bed9ccc51b11d7d3f  gnutls-3.1.16.tar.xz
++7780e9ca7b592350ce9b11e53a63d3212320402d8ad2462bfbc0e69aec4a48bb372a1925627abb7996535c87c90e3d79537ea118c8bb36d26aae8e19eaae3a06  gnutls-2.12.23.tar.bz2
+diff --git a/contrib/src/gnutls/rules.mak b/contrib/src/gnutls/rules.mak
+index 7d997d8..0e3ffbb 100644
+--- a/contrib/src/gnutls/rules.mak
++++ b/contrib/src/gnutls/rules.mak
+@@ -1,32 +1,20 @@
+ # GnuTLS
+ 
+-GNUTLS_VERSION := 3.1.16
+-GNUTLS_URL := ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/gnutls-$(GNUTLS_VERSION).tar.xz
++GNUTLS_VERSION := 2.12.23
++GNUTLS_URL := ftp://ftp.gnutls.org/gcrypt/gnutls/v2.12/gnutls-$(GNUTLS_VERSION).tar.bz2
+ 
+ PKGS += gnutls
+ ifeq ($(call need_pkg,"gnutls >= 3.0.20"),)
+ PKGS_FOUND += gnutls
+ endif
+ 
+-$(TARBALLS)/gnutls-$(GNUTLS_VERSION).tar.xz:
++$(TARBALLS)/gnutls-$(GNUTLS_VERSION).tar.bz2:
+ 	$(call download,$(GNUTLS_URL))
+ 
+-.sum-gnutls: gnutls-$(GNUTLS_VERSION).tar.xz
++.sum-gnutls: gnutls-$(GNUTLS_VERSION).tar.bz2
+ 
+-gnutls: gnutls-$(GNUTLS_VERSION).tar.xz .sum-gnutls
++gnutls: gnutls-$(GNUTLS_VERSION).tar.bz2 .sum-gnutls
+ 	$(UNPACK)
+-ifdef HAVE_WIN32
+-	$(APPLY) $(SRC)/gnutls/gnutls-win32.patch
+-endif
+-ifdef HAVE_ANDROID
+-	$(APPLY) $(SRC)/gnutls/no-create-time-h.patch
+-endif
+-	$(APPLY) $(SRC)/gnutls/gnutls-no-egd.patch
+-	$(APPLY) $(SRC)/gnutls/read-file-limits.h.patch
+-	$(APPLY) $(SRC)/gnutls/downgrade-automake-requirement.patch
+-ifdef HAVE_MACOSX
+-	$(APPLY) $(SRC)/gnutls/mac-keychain-lookup.patch
+-endif
+ 	$(call pkg_static,"lib/gnutls.pc.in")
+ 	$(UPDATE_AUTOCONFIG)
+ 	$(MOVE)
+@@ -43,9 +31,10 @@ GNUTLS_CONF := \
+ 	--disable-guile \
+ 	--disable-nls \
+ 	--without-libintl-prefix \
++	--with-libgcrypt \
+ 	$(HOSTCONF)
+ 
+-DEPS_gnutls = nettle $(DEPS_nettle)
++DEPS_gnutls = gcrypt $(DEPS_gcrypt)
+ 
+ .gnutls: gnutls
+ ifndef HAVE_IOS
+-- 
+1.8.3.4 (Apple Git-47)
+

+ 49 - 0
MobileVLCKit/patches/0022-contrib-gcrypt-patch-the-external-API-so-old-gnutls-.patch

@@ -0,0 +1,68 @@
+From 1f2e656375d41758ca29e9c4196b6e3f6aed2065 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
+Date: Thu, 21 Nov 2013 02:40:27 +0100
+Subject: [PATCH 22/23] contrib/gcrypt: patch the external API so old gnutls
+ versions can still access what they need
+
+---
+ .../gcrypt/fixup-external-api-for-old-gnutls.patch | 35 ++++++++++++++++++++++
+ contrib/src/gcrypt/rules.mak                       |  1 +
+ 2 files changed, 36 insertions(+)
+ create mode 100644 contrib/src/gcrypt/fixup-external-api-for-old-gnutls.patch
+
+diff --git a/contrib/src/gcrypt/fixup-external-api-for-old-gnutls.patch b/contrib/src/gcrypt/fixup-external-api-for-old-gnutls.patch
+new file mode 100644
+index 0000000..2f5fa63
+--- /dev/null
++++ b/contrib/src/gcrypt/fixup-external-api-for-old-gnutls.patch
+@@ -0,0 +1,35 @@
++diff -ru libgcrypt/src/gcrypt.h.in libgcrypt-fixed/src/gcrypt.h.in
++--- libgcrypt/src/gcrypt.h.in	2013-11-21 01:22:12.000000000 +0100
+++++ libgcrypt-fixed/src/gcrypt.h.in	2013-11-21 01:26:15.000000000 +0100
++@@ -217,6 +217,30 @@
++        Bits  7 - 0  are used for the thread model
++        Bits 15 - 8  are used for the version number.  */
++   unsigned int option;
+++#ifdef _WIN32
+++		     struct timeval *timeout);
+++#else
+++		     struct timeval *timeout);
+++#endif
++ } _GCRY_ATTR_INTERNAL;
++ 
++ #define GCRY_THREAD_OPTION_PTH_IMPL                                     \
++
+diff --git a/contrib/src/gcrypt/rules.mak b/contrib/src/gcrypt/rules.mak
+index 332d2ad..305e5c8 100644
+--- a/contrib/src/gcrypt/rules.mak
++++ b/contrib/src/gcrypt/rules.mak
+@@ -22,6 +22,7 @@ libgcrypt: libgcrypt-git.tar.xz .sum-gcrypt
+ 	$(UNPACK)
+ 	$(APPLY) $(SRC)/gcrypt/disable-doc-compilation.patch
+ 	$(APPLY) $(SRC)/gcrypt/work-around-libtool-limitation.patch
++	$(APPLY) $(SRC)/gcrypt/fixup-external-api-for-old-gnutls.patch
+ 	$(MOVE)
+ endif
+ 
+-- 
+1.8.3.4 (Apple Git-47)
+

+ 1 - 1
MobileVLCKit/patches/0023-lib-media_player-inherit-deinterlace-and-vbi-variabl.patch

@@ -1,4 +1,4 @@
-From 372ba9d5696c00400e87eeaa07124c3e194b4312 Mon Sep 17 00:00:00 2001
+From f23a4b6f9d74f7ffa4d5316f5307bdb32b79c11a Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
 Date: Thu, 21 Nov 2013 16:26:40 +0100
 Subject: [PATCH 23/23] lib/media_player: inherit deinterlace and vbi variables

+ 1 - 1
buildMobileVLCKit.sh

@@ -12,7 +12,7 @@ CONFIGURATION="Release"
 NONETWORK=no
 SKIPLIBVLCCOMPILATION=no
 
-TESTEDHASH=a69fb3d49
+TESTEDHASH=6b77e629f
 
 usage()
 {