summaryrefslogtreecommitdiff
path: root/package/vlc
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2016-09-24 22:23:58 +0200
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-09-24 22:27:25 +0200
commit3489adabed6655c084b7a4e43f3e8ab38ae56072 (patch)
tree697f74bd8f90af352bc965e6d2a0537c1ac2f11f /package/vlc
parent0ba6cb19afd16f5c04297984d4120ee880b2493c (diff)
vlc: update to 2.2.4, add buildroot patchsets
Diffstat (limited to 'package/vlc')
-rw-r--r--package/vlc/Makefile10
-rw-r--r--package/vlc/patches/patch-Makefile_am11
-rw-r--r--package/vlc/patches/patch-bin_Makefile_am11
-rw-r--r--package/vlc/patches/patch-configure_ac122
-rw-r--r--package/vlc/patches/patch-include_vlc_fixups_h14
-rw-r--r--package/vlc/patches/patch-modules_codec_avcodec_audio_c11
-rw-r--r--package/vlc/patches/patch-modules_codec_avcodec_encoder_c92
-rw-r--r--package/vlc/patches/patch-modules_codec_avcodec_vaapi_c11
-rw-r--r--package/vlc/patches/patch-modules_codec_avcodec_video_c51
-rw-r--r--package/vlc/patches/patch-modules_demux_avformat_demux_c46
-rw-r--r--package/vlc/patches/patch-src_posix_error_c19
-rw-r--r--package/vlc/patches/patch-src_posix_thread_c11
12 files changed, 402 insertions, 7 deletions
diff --git a/package/vlc/Makefile b/package/vlc/Makefile
index 24341fbc7..bebe85382 100644
--- a/package/vlc/Makefile
+++ b/package/vlc/Makefile
@@ -4,9 +4,9 @@
include $(ADK_TOPDIR)/rules.mk
PKG_NAME:= vlc
-PKG_VERSION:= 2.2.1
+PKG_VERSION:= 2.2.4
PKG_RELEASE:= 1
-PKG_HASH:= 543d9d7e378ec0fa1ee2e7f7f5acf8c456c7d0ecc32037171523197ef3cf1fcb
+PKG_HASH:= 1632e91d2a0087e0ef4c3fb4c95c3c2890f7715a9d1d43ffd46329f428cf53be
PKG_DESCR:= popular media player
PKG_SECTION:= mm/video
PKG_BUILDDEP:= ffmpeg xcb-util libgcrypt alsa-lib
@@ -48,6 +48,8 @@ $(eval $(call PKG_template,VLC,vlc,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},
TARGET_CPPFLAGS+= -D_DEFAULT_SOURCE
TARGET_CFLAGS+= -fPIC
+
+AUTOTOOL_STYLE:= autoreconf
CONFIGURE_ENV+= ac_cv_func_sched_getaffinity=no
CONFIGURE_ARGS+= --disable-lua \
--disable-dbus \
@@ -71,9 +73,9 @@ CONFIGURE_ARGS+= --disable-neon
endif
ifneq ($(ADK_PACKAGE_VLC_WITH_BLURAY),)
-CONFIGURE_ARGS+= --enable-libbluray
+CONFIGURE_ARGS+= --enable-bluray
else
-CONFIGURE_ARGS+= --disable-libbluray
+CONFIGURE_ARGS+= --disable-bluray
endif
ifneq ($(ADK_PACKAGE_VLC_WITH_MAD),)
CONFIGURE_ARGS+= --enable-mad
diff --git a/package/vlc/patches/patch-Makefile_am b/package/vlc/patches/patch-Makefile_am
new file mode 100644
index 000000000..b41062e43
--- /dev/null
+++ b/package/vlc/patches/patch-Makefile_am
@@ -0,0 +1,11 @@
+--- vlc-2.2.4.orig/Makefile.am 2015-10-21 19:48:45.000000000 +0200
++++ vlc-2.2.4/Makefile.am 2016-09-24 20:37:45.255479549 +0200
+@@ -933,7 +933,7 @@ libvlc: libvlccore
+ cd lib && $(MAKE) $(AM_MAKEFLAGS) libvlc.la
+
+ core: libvlc vlc$(EXEEXT)
+- cd bin && $(MAKE) $(AM_MAKEFLAGS) vlc$(EXEEXT) vlc-static$(EXEEXT)
++ cd bin && $(MAKE) $(AM_MAKEFLAGS) vlc$(EXEEXT)
+
+ doc:
+ cd doc && $(MAKE) $(AM_MAKEFLAGS) doc
diff --git a/package/vlc/patches/patch-bin_Makefile_am b/package/vlc/patches/patch-bin_Makefile_am
new file mode 100644
index 000000000..5a3ea1bb2
--- /dev/null
+++ b/package/vlc/patches/patch-bin_Makefile_am
@@ -0,0 +1,11 @@
+--- vlc-2.2.4.orig/bin/Makefile.am 2015-02-02 20:42:28.000000000 +0100
++++ vlc-2.2.4/bin/Makefile.am 2016-09-24 20:37:45.251479394 +0200
+@@ -1,7 +1,7 @@
+ # Building vlc
+ #
+ bin_PROGRAMS = vlc
+-noinst_PROGRAMS = vlc-static
++noinst_PROGRAMS =
+ noinst_DATA =
+ vlclib_PROGRAMS = vlc-cache-gen
+ EXTRA_PROGRAMS = vlc-wrapper
diff --git a/package/vlc/patches/patch-configure_ac b/package/vlc/patches/patch-configure_ac
new file mode 100644
index 000000000..dcae06228
--- /dev/null
+++ b/package/vlc/patches/patch-configure_ac
@@ -0,0 +1,122 @@
+--- vlc-2.2.4.orig/configure.ac 2016-05-31 18:11:07.000000000 +0200
++++ vlc-2.2.4/configure.ac 2016-09-24 20:38:04.944241100 +0200
+@@ -24,7 +24,7 @@ AC_CANONICAL_BUILD
+ AC_CANONICAL_HOST
+ AC_PRESERVE_HELP_ORDER
+
+-AM_INIT_AUTOMAKE(tar-ustar color-tests foreign)
++AM_INIT_AUTOMAKE(tar-ustar color-tests foreign subdir-objects)
+ AC_CONFIG_HEADERS([config.h])
+
+ # Disable with "./configure --disable-silent-rules" or "make V=1"
+@@ -121,6 +121,7 @@ case "${host_os}" in
+ ;;
+ linux*)
+ SYS=linux
++ AC_CHECK_LIB([rt], [posix_spawnp], [VLC_ADD_LIBS([libvlccore],[-lrt])], [], [])
+ ;;
+ bsdi*)
+ SYS=bsdi
+@@ -534,7 +535,7 @@ need_libc=false
+
+ dnl Check for usual libc functions
+ AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
+-AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r isatty lstat memalign mmap open_memstream openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale])
++AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r isatty lstat memalign mmap open_memstream openat pread posix_fadvise posix_madvise setlocale strerror_l stricmp strnicmp strptime uselocale])
+ AC_REPLACE_FUNCS([atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r lldiv localtime_r nrand48 poll posix_memalign rewind setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strsep strtof strtok_r strtoll swab tdestroy strverscmp])
+ AC_CHECK_FUNCS(fdatasync,,
+ [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
+@@ -864,7 +865,7 @@ dnl
+ dnl Compiler warnings
+ dnl
+
+-RDC_PROG_CC_WFLAGS([all extra sign-compare undef pointer-arith bad-function-cast write-strings missing-prototypes volatile-register-var error-implicit-function-declaration])
++RDC_PROG_CC_WFLAGS([all extra sign-compare undef pointer-arith bad-function-cast write-strings missing-prototypes volatile-register-var])
+ RDC_PROG_CC_FLAGS([-pipe])
+ AC_LANG_PUSH([C++])
+ RDC_PROG_CXX_WFLAGS([all extra sign-compare undef pointer-arith volatile-register-var])
+@@ -2324,7 +2325,7 @@ AC_ARG_ENABLE(avcodec,
+ AS_IF([test "${enable_avcodec}" != "no"], [
+ PKG_CHECK_MODULES(AVCODEC,[libavcodec >= 53.34.0 libavutil >= 51.22.0], [
+ PKG_CHECK_EXISTS([libavutil < 55],, [
+- AC_MSG_ERROR([libavutil versions 55 and later are not supported.])
++ AC_MSG_WARN([libavutil versions 55 and later are not supported.])
+ ])
+ VLC_SAVE_FLAGS
+ CPPFLAGS="${CPPFLAGS} ${AVCODEC_CFLAGS}"
+@@ -2334,7 +2335,7 @@ AS_IF([test "${enable_avcodec}" != "no"]
+ VLC_RESTORE_FLAGS
+ have_avcodec="yes"
+ ],[
+- AC_MSG_ERROR([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
++ AC_MSG_WARN([${AVCODEC_PKG_ERRORS}. Pass --disable-avcodec to ignore this error.])
+ ])
+ ], [
+ have_avcodec="no"
+@@ -2383,7 +2384,7 @@ AS_IF([test "${have_vaapi}" = "yes" -a "
+ case "${avfork}" in
+ ffmpeg)
+ PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
+- AC_MSG_ERROR([VA API requires FFmpeg libavcodec < 57.10 or libav.])
++ AC_MSG_WARN([VA API requires FFmpeg libavcodec < 57.10 or libav.])
+ ])
+ ;;
+ esac
+@@ -2417,7 +2418,7 @@ AS_IF([test "${enable_dxva2}" != "no"],
+ case "${avfork}" in
+ ffmpeg)
+ PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
+- AC_MSG_ERROR([DXVA2 requires FFmpeg libavcodec < 57.10 or libav.])
++ AC_MSG_WARN([DXVA2 requires FFmpeg libavcodec < 57.10 or libav.])
+ ])
+ ;;
+ esac
+@@ -2509,7 +2510,7 @@ AS_IF([test "${enable_avformat}" != "no"
+ ])
+ VLC_RESTORE_FLAGS
+ ],[
+- AC_MSG_ERROR([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
++ AC_MSG_WARN([${AVFORMAT_PKG_ERRORS}. Pass --disable-avformat to ignore this error.])
+ ])
+ ])
+ AM_CONDITIONAL([HAVE_AVFORMAT], [test "${enable_avformat}" != "no"])
+@@ -2538,7 +2539,7 @@ then
+ ])
+ VLC_RESTORE_FLAGS
+ ],[
+- AC_MSG_ERROR([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
++ AC_MSG_WARN([${SWSCALE_PKG_ERRORS}. Pass --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
+ ])
+ fi
+
+@@ -3181,7 +3182,7 @@ AS_IF([test "${have_vdpau}" = "yes" -a "
+ libav) av_vdpau_ver="55.26.0" ;;
+ ffmpeg) av_vdpau_ver="55.42.100"
+ PKG_CHECK_EXISTS([libavcodec >= 57.10.100], [
+- AC_MSG_ERROR([VDPAU requires FFmpeg libavcodec < 57.10 or libav.])
++ AC_MSG_WARN([VDPAU requires FFmpeg libavcodec < 57.10 or libav.])
+ ])
+ ;;
+ esac
+@@ -4062,16 +4063,17 @@ dnl
+ AC_ARG_ENABLE(libgcrypt,
+ [ --disable-libgcrypt gcrypt support (default enabled)])
+ AS_IF([test "${enable_libgcrypt}" != "no"], [
++ AC_PATH_PROG([GCRYPT_CONFIG],[libgcrypt-config],[libgcrypt-config])
+ AC_CHECK_DECL([GCRYCTL_SET_THREAD_CBS], [
+- libgcrypt-config --version >/dev/null || \
++ ${GCRYPT_CONFIG} --version >/dev/null || \
+ AC_MSG_ERROR([gcrypt.h present but libgcrypt-config could not be found])
+ AC_CHECK_LIB(gcrypt, gcry_control, [
+ have_libgcrypt="yes"
+- GCRYPT_CFLAGS="`libgcrypt-config --cflags`"
+- GCRYPT_LIBS="`libgcrypt-config --libs`"
++ GCRYPT_CFLAGS="`${GCRYPT_CONFIG} --cflags`"
++ GCRYPT_LIBS="`${GCRYPT_CONFIG} --libs`"
+ ], [
+ AC_MSG_ERROR([libgcrypt not found. Install libgcrypt or pass --disable-libgcrypt.])
+- ], [`libgcrypt-config --libs`])
++ ], [`${GCRYPT_CONFIG} --libs`])
+ ], [
+ AC_MSG_ERROR([libgcrypt version 1.1.94 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
+ ], [#include <gcrypt.h>]
diff --git a/package/vlc/patches/patch-include_vlc_fixups_h b/package/vlc/patches/patch-include_vlc_fixups_h
new file mode 100644
index 000000000..f9ff68fdf
--- /dev/null
+++ b/package/vlc/patches/patch-include_vlc_fixups_h
@@ -0,0 +1,14 @@
+--- vlc-2.2.4.orig/include/vlc_fixups.h 2015-02-24 17:58:52.000000000 +0100
++++ vlc-2.2.4/include/vlc_fixups.h 2016-09-24 20:58:19.747228936 +0200
+@@ -239,11 +239,6 @@ static inline locale_t newlocale(int mas
+ }
+ #endif
+
+-#if !defined (HAVE_STATIC_ASSERT)
+-# define _Static_assert(x, s) ((void) sizeof (struct { unsigned:-!(x); }))
+-# define static_assert _Static_assert
+-#endif
+-
+ /* Alignment of critical static data structures */
+ #ifdef ATTRIBUTE_ALIGNED_MAX
+ # define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < align) ? ATTRIBUTE_ALIGNED_MAX : align)))
diff --git a/package/vlc/patches/patch-modules_codec_avcodec_audio_c b/package/vlc/patches/patch-modules_codec_avcodec_audio_c
new file mode 100644
index 000000000..9dfaff716
--- /dev/null
+++ b/package/vlc/patches/patch-modules_codec_avcodec_audio_c
@@ -0,0 +1,11 @@
+--- vlc-2.2.4.orig/modules/codec/avcodec/audio.c 2016-01-18 21:49:57.000000000 +0100
++++ vlc-2.2.4/modules/codec/avcodec/audio.c 2016-09-24 20:35:02.681191261 +0200
+@@ -39,7 +39,7 @@
+ #include <libavcodec/avcodec.h>
+ #include <libavutil/mem.h>
+
+-#include <libavutil/audioconvert.h>
++#include <libavutil/channel_layout.h>
+
+ #include "avcodec.h"
+
diff --git a/package/vlc/patches/patch-modules_codec_avcodec_encoder_c b/package/vlc/patches/patch-modules_codec_avcodec_encoder_c
new file mode 100644
index 000000000..3766addf8
--- /dev/null
+++ b/package/vlc/patches/patch-modules_codec_avcodec_encoder_c
@@ -0,0 +1,92 @@
+--- vlc-2.2.4.orig/modules/codec/avcodec/encoder.c 2015-10-21 19:48:45.000000000 +0200
++++ vlc-2.2.4/modules/codec/avcodec/encoder.c 2016-09-24 20:35:02.681191261 +0200
+@@ -41,7 +41,7 @@
+ #include <vlc_cpu.h>
+
+ #include <libavcodec/avcodec.h>
+-#include <libavutil/audioconvert.h>
++#include <libavutil/channel_layout.h>
+
+ #include "avcodec.h"
+ #include "avcommon.h"
+@@ -311,7 +311,7 @@ int OpenEncoder( vlc_object_t *p_this )
+ else if( !GetFfmpegCodec( p_enc->fmt_out.i_codec, &i_cat, &i_codec_id,
+ &psz_namecodec ) )
+ {
+- if( FindFfmpegChroma( p_enc->fmt_out.i_codec ) == PIX_FMT_NONE )
++ if( FindFfmpegChroma( p_enc->fmt_out.i_codec ) == AV_PIX_FMT_NONE )
+ return VLC_EGENERIC; /* handed chroma output */
+
+ i_cat = VIDEO_ES;
+@@ -555,7 +555,7 @@ int OpenEncoder( vlc_object_t *p_this )
+
+ if( p_codec->pix_fmts )
+ {
+- const enum PixelFormat *p = p_codec->pix_fmts;
++ const enum AVPixelFormat *p = p_codec->pix_fmts;
+ for( ; *p != -1; p++ )
+ {
+ if( *p == p_context->pix_fmt ) break;
+@@ -1017,7 +1017,7 @@ errmsg:
+ }
+ }
+
+- p_sys->frame = avcodec_alloc_frame();
++ p_sys->frame = av_frame_alloc();
+ if( !p_sys->frame )
+ {
+ goto error;
+@@ -1048,7 +1048,7 @@ static void vlc_av_packet_Release(block_
+ {
+ vlc_av_packet_t *b = (void *) block;
+
+- av_free_packet(&b->packet);
++ av_packet_unref(&b->packet);
+ free(b);
+ }
+
+@@ -1088,7 +1088,7 @@ static block_t *EncodeVideo( encoder_t *
+ AVFrame *frame = NULL;
+ if( likely(p_pict) ) {
+ frame = p_sys->frame;
+- avcodec_get_frame_defaults( frame );
++ av_frame_unref( frame );
+ for( i_plane = 0; i_plane < p_pict->i_planes; i_plane++ )
+ {
+ p_sys->frame->data[i_plane] = p_pict->p[i_plane].p_pixels;
+@@ -1188,7 +1188,7 @@ static block_t *EncodeVideo( encoder_t *
+ av_pkt.duration / p_sys->p_context->time_base.den, p_sys->p_context );
+ if( unlikely(p_block == NULL) )
+ {
+- av_free_packet( &av_pkt );
++ av_packet_unref( &av_pkt );
+ return NULL;
+ }
+
+@@ -1329,7 +1329,7 @@ static block_t *handle_delay_buffer( enc
+ //How much we need to copy from new packet
+ const int leftover = leftover_samples * p_sys->p_context->channels * p_sys->i_sample_bytes;
+
+- avcodec_get_frame_defaults( p_sys->frame );
++ av_frame_unref( p_sys->frame );
+ p_sys->frame->format = p_sys->p_context->sample_fmt;
+ p_sys->frame->nb_samples = leftover_samples + p_sys->i_samples_delay;
+
+@@ -1451,7 +1451,7 @@ static block_t *EncodeAudio( encoder_t *
+ while( ( p_aout_buf->i_nb_samples >= p_sys->i_frame_size ) ||
+ ( p_sys->b_variable && p_aout_buf->i_nb_samples ) )
+ {
+- avcodec_get_frame_defaults( p_sys->frame );
++ av_frame_unref( p_sys->frame );
+ if( p_sys->b_variable )
+ p_sys->frame->nb_samples = p_aout_buf->i_nb_samples;
+ else
+@@ -1514,7 +1514,7 @@ void CloseEncoder( vlc_object_t *p_this
+ encoder_t *p_enc = (encoder_t *)p_this;
+ encoder_sys_t *p_sys = p_enc->p_sys;
+
+- /*FIXME: we should use avcodec_free_frame, but we don't require so new avcodec that has it*/
++ /*FIXME: we should use av_frame_free, but we don't require so new avcodec that has it*/
+ av_freep( &p_sys->frame );
+
+ vlc_avcodec_lock();
diff --git a/package/vlc/patches/patch-modules_codec_avcodec_vaapi_c b/package/vlc/patches/patch-modules_codec_avcodec_vaapi_c
new file mode 100644
index 000000000..1fdad6258
--- /dev/null
+++ b/package/vlc/patches/patch-modules_codec_avcodec_vaapi_c
@@ -0,0 +1,11 @@
+--- vlc-2.2.4.orig/modules/codec/avcodec/vaapi.c 2015-02-02 20:42:29.000000000 +0100
++++ vlc-2.2.4/modules/codec/avcodec/vaapi.c 2016-09-24 20:35:02.681191261 +0200
+@@ -595,7 +595,7 @@ static int Create( vlc_va_t *p_va, AVCod
+ return err;
+
+ /* Only VLD supported */
+- p_va->pix_fmt = PIX_FMT_VAAPI_VLD;
++ p_va->pix_fmt = AV_PIX_FMT_VAAPI_VLD;
+ p_va->setup = Setup;
+ p_va->get = Get;
+ p_va->release = Release;
diff --git a/package/vlc/patches/patch-modules_codec_avcodec_video_c b/package/vlc/patches/patch-modules_codec_avcodec_video_c
new file mode 100644
index 000000000..07e2728e3
--- /dev/null
+++ b/package/vlc/patches/patch-modules_codec_avcodec_video_c
@@ -0,0 +1,51 @@
+--- vlc-2.2.4.orig/modules/codec/avcodec/video.c 2016-04-07 21:36:15.000000000 +0200
++++ vlc-2.2.4/modules/codec/avcodec/video.c 2016-09-24 20:35:02.681191261 +0200
+@@ -108,8 +108,8 @@ static int lavc_GetFrame(struct AVCodecC
+ static int ffmpeg_GetFrameBuf ( struct AVCodecContext *, AVFrame * );
+ static void ffmpeg_ReleaseFrameBuf( struct AVCodecContext *, AVFrame * );
+ #endif
+-static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *,
+- const enum PixelFormat * );
++static enum AVPixelFormat ffmpeg_GetFormat( AVCodecContext *,
++ const enum AVPixelFormat * );
+
+ static uint32_t ffmpeg_CodecTag( vlc_fourcc_t fcc )
+ {
+@@ -234,7 +234,7 @@ int InitVideoDec( decoder_t *p_dec, AVCo
+ p_sys->p_codec = p_codec;
+ p_sys->i_codec_id = i_codec_id;
+ p_sys->psz_namecodec = psz_namecodec;
+- p_sys->p_ff_pic = avcodec_alloc_frame();
++ p_sys->p_ff_pic = av_frame_alloc();
+ p_sys->b_delayed_open = true;
+ p_sys->p_va = NULL;
+ vlc_sem_init( &p_sys->sem_mt, 0 );
+@@ -446,7 +446,7 @@ int InitVideoDec( decoder_t *p_dec, AVCo
+ if( ffmpeg_OpenCodec( p_dec ) < 0 )
+ {
+ msg_Err( p_dec, "cannot open codec (%s)", p_sys->psz_namecodec );
+- avcodec_free_frame( &p_sys->p_ff_pic );
++ av_frame_free( &p_sys->p_ff_pic );
+ vlc_sem_destroy( &p_sys->sem_mt );
+ free( p_sys );
+ return VLC_EGENERIC;
+@@ -826,7 +826,7 @@ void EndVideoDec( decoder_t *p_dec )
+ wait_mt( p_sys );
+
+ if( p_sys->p_ff_pic )
+- avcodec_free_frame( &p_sys->p_ff_pic );
++ av_frame_free( &p_sys->p_ff_pic );
+
+ if( p_sys->p_va )
+ vlc_va_Delete( p_sys->p_va );
+@@ -1313,8 +1313,8 @@ static void ffmpeg_ReleaseFrameBuf( stru
+ }
+ #endif
+
+-static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
+- const enum PixelFormat *pi_fmt )
++static enum AVPixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
++ const enum AVPixelFormat *pi_fmt )
+ {
+ decoder_t *p_dec = p_context->opaque;
+ decoder_sys_t *p_sys = p_dec->p_sys;
diff --git a/package/vlc/patches/patch-modules_demux_avformat_demux_c b/package/vlc/patches/patch-modules_demux_avformat_demux_c
new file mode 100644
index 000000000..ca710b26b
--- /dev/null
+++ b/package/vlc/patches/patch-modules_demux_avformat_demux_c
@@ -0,0 +1,46 @@
+--- vlc-2.2.4.orig/modules/demux/avformat/demux.c 2016-01-18 21:49:57.000000000 +0100
++++ vlc-2.2.4/modules/demux/avformat/demux.c 2016-09-24 20:35:02.681191261 +0200
+@@ -734,14 +734,14 @@ static int Demux( demux_t *p_demux )
+ }
+ if( pkt.stream_index < 0 || pkt.stream_index >= p_sys->i_tk )
+ {
+- av_free_packet( &pkt );
++ av_packet_unref( &pkt );
+ return 1;
+ }
+ const AVStream *p_stream = p_sys->ic->streams[pkt.stream_index];
+ if( p_stream->time_base.den <= 0 )
+ {
+ msg_Warn( p_demux, "Invalid time base for the stream %d", pkt.stream_index );
+- av_free_packet( &pkt );
++ av_packet_unref( &pkt );
+ return 1;
+ }
+ if( p_stream->codec->codec_id == AV_CODEC_ID_SSA )
+@@ -749,7 +749,7 @@ static int Demux( demux_t *p_demux )
+ p_frame = BuildSsaFrame( &pkt, p_sys->i_ssa_order++ );
+ if( !p_frame )
+ {
+- av_free_packet( &pkt );
++ av_packet_unref( &pkt );
+ return 1;
+ }
+ }
+@@ -757,7 +757,7 @@ static int Demux( demux_t *p_demux )
+ {
+ if( ( p_frame = block_Alloc( pkt.size ) ) == NULL )
+ {
+- av_free_packet( &pkt );
++ av_packet_unref( &pkt );
+ return 0;
+ }
+ memcpy( p_frame->p_buffer, pkt.data, pkt.size );
+@@ -838,7 +838,7 @@ static int Demux( demux_t *p_demux )
+ else
+ block_Release( p_frame );
+
+- av_free_packet( &pkt );
++ av_packet_unref( &pkt );
+ return 1;
+ }
+
diff --git a/package/vlc/patches/patch-src_posix_error_c b/package/vlc/patches/patch-src_posix_error_c
index 3e720ec00..ef51c996e 100644
--- a/package/vlc/patches/patch-src_posix_error_c
+++ b/package/vlc/patches/patch-src_posix_error_c
@@ -1,6 +1,14 @@
---- vlc-2.2.1.orig/src/posix/error.c 2014-08-14 02:20:04.000000000 -0500
-+++ vlc-2.2.1/src/posix/error.c 2015-04-25 21:13:22.287684003 -0500
-@@ -48,7 +48,11 @@ static const char *vlc_strerror_l(int er
+--- vlc-2.2.4.orig/src/posix/error.c 2015-02-02 20:42:32.000000000 +0100
++++ vlc-2.2.4/src/posix/error.c 2016-09-24 20:34:45.824539253 +0200
+@@ -31,6 +31,7 @@
+
+ static const char *vlc_strerror_l(int errnum, const char *lname)
+ {
++#ifdef HAVE_STRERROR_L
+ int saved_errno = errno;
+ locale_t loc = newlocale(LC_MESSAGES_MASK, lname, (locale_t)0);
+
+@@ -48,9 +49,16 @@ static const char *vlc_strerror_l(int er
errno = saved_errno;
}
@@ -11,4 +19,9 @@
+#endif
freelocale(loc);
++#else
++ const char *buf = strerror(errnum);
++#endif
return buf;
+ }
+
diff --git a/package/vlc/patches/patch-src_posix_thread_c b/package/vlc/patches/patch-src_posix_thread_c
new file mode 100644
index 000000000..5c636c164
--- /dev/null
+++ b/package/vlc/patches/patch-src_posix_thread_c
@@ -0,0 +1,11 @@
+--- vlc-2.2.4.orig/src/posix/thread.c 2015-02-02 20:42:32.000000000 +0100
++++ vlc-2.2.4/src/posix/thread.c 2016-09-24 20:34:51.776769484 +0200
+@@ -85,7 +85,7 @@ static clockid_t vlc_clock_id;
+
+ static void vlc_clock_setup_once (void)
+ {
+-# if (_POSIX_MONOTONIC_CLOCK == 0)
++# if (_POSIX_MONOTONIC_CLOCK == 0) && (_POSIX_CLOCK_SELECTION > 0)
+ long val = sysconf (_SC_MONOTONIC_CLOCK);
+ assert (val != 0);
+ vlc_clock_id = (val < 0) ? CLOCK_REALTIME : CLOCK_MONOTONIC;