Yocto 2.3

Move OpenBMC to Yocto 2.3(pyro).

Tested: Built and verified Witherspoon and Palmetto images
Change-Id: I50744030e771f4850afc2a93a10d3507e76d36bc
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Resolves: openbmc/openbmc#2461
diff --git a/import-layers/meta-openembedded/meta-multimedia/README b/import-layers/meta-openembedded/meta-multimedia/README
index c540bed..abdc1a2 100644
--- a/import-layers/meta-openembedded/meta-multimedia/README
+++ b/import-layers/meta-openembedded/meta-multimedia/README
@@ -1,20 +1,20 @@
 This layer depends on:
 
 URI: git://github.com/openembedded/oe-core.git
-branch: morty
+branch: pyro
 revision: HEAD
 
 URI: git://github.com/openembedded/meta-oe.git
 layers: meta-oe, meta-ruby
-branch: morty
+branch: pyro
 revision: HEAD
 
-Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-multimedia]' in the subject'
+Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-multimedia][pyro]' in the subject'
 
 When sending single patches, please use something like:
-'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-multimedia][morty][PATCH
+'git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-multimedia][pyro][PATCH
 
 You are encouraged to fork the mirror on github https://github.com/openembedded/meta-oe/ to share your patches, this is preferred for patch sets consisting of more than one patch. Other services like gitorious, repo.or.cz or self hosted setups are of course accepted as well, 'git fetch <remote>' works the same on all of them. We recommend github because it is free, easy to use, has been proven to be reliable and has a really good web GUI.
 
-morty branch maintainer(s):
+pyro Branch Maintainer:
 Armin Kuster <akuster808@gmail.com>
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/gupnp/gupnp-igd_0.2.2.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/gupnp/gupnp-igd_0.2.2.bb
index 0cc4a3a..440e826 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/gupnp/gupnp-igd_0.2.2.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/gupnp/gupnp-igd_0.2.2.bb
@@ -12,3 +12,5 @@
 inherit autotools pkgconfig gtk-doc gobject-introspection
 
 EXTRA_OECONF = "--disable-python"
+
+PNBLACKLIST[gupnp-igd] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130645/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/gupnp/gupnp-tools_0.8.10.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/gupnp/gupnp-tools_0.8.10.bb
index eda70e8..ba7f825 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/gupnp/gupnp-tools_0.8.10.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/gupnp/gupnp-tools_0.8.10.bb
@@ -10,3 +10,5 @@
 SRC_URI[sha256sum] = "592c53289ff1cd70e676405c56ca87b28d2da37a385d34a3bb9b944ba9108d17"
 
 inherit autotools pkgconfig
+
+PNBLACKLIST[gupnp-tools] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130670/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/miniupnpd/miniupnpd_2.0.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/miniupnpd/miniupnpd_2.0.bb
new file mode 100644
index 0000000..bb361a1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/miniupnpd/miniupnpd_2.0.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Lightweight UPnP IGD daemon"
+DESCRIPTION = "The miniUPnP daemon is an UPnP IGD (internet gateway device) \
+which provide NAT traversal services to any UPnP enabled client on \
+the network."
+
+SECTION = "networking"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=aa71c78c373ccfe0ff207af0cd966d91"
+
+inherit autotools gettext pkgconfig
+
+DEPENDS += "iptables net-tools util-linux libmnl libnetfilter-conntrack"
+
+SRC_URI = "http://miniupnp.tuxfamily.org/files/download.php?file=${P}.tar.gz \
+"
+SRC_URI[md5sum] = "1c07a215dd9b362e75a9efc05e2fb3b4"
+SRC_URI[sha256sum] = "d96aa3a00e0f5490826bba3cb97e68cd27479e5839adac4b9bcb66eae786bfb7"
+
+IPV6 = "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', '--ipv6', '', d)}"
+
+do_compile() {
+    cd ${S}
+    CONFIG_OPTIONS="${IPV6} --leasefile" ./genconfig.sh
+    oe_runmake -f Makefile.linux
+}
+
+do_install() {
+    install -d ${D}/${sbindir}
+    install ${S}/miniupnpd ${D}/${sbindir}
+    install -d ${D}/${sysconfdir}/${BPN}
+    install ${S}/netfilter/iptables_init.sh ${D}/${sysconfdir}/${BPN}
+    install ${S}/netfilter/iptables_removeall.sh ${D}/${sysconfdir}/${BPN}
+    install ${S}/netfilter/ip6tables_init.sh ${D}/${sysconfdir}/${BPN}
+    install ${S}/netfilter/ip6tables_removeall.sh ${D}/${sysconfdir}/${BPN}
+    install -m 0644 -b ${S}/miniupnpd.conf ${D}/${sysconfdir}/${BPN}
+    install -d ${D}/${sysconfdir}/init.d
+    install ${S}/linux/miniupnpd.init.d.script ${D}/${sysconfdir}/init.d/miniupnpd
+}
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/rygel/rygel_0.28.2.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/rygel/rygel_0.28.2.bb
index 79ff6e2..38fac65 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/rygel/rygel_0.28.2.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-connectivity/rygel/rygel_0.28.2.bb
@@ -48,12 +48,12 @@
 
 python populate_packages_prepend () {
     rygel_libdir = d.expand('${libdir}/rygel-${LIBV}')
-    postinst = d.getVar('plugin_postinst', True)
+    postinst = d.getVar('plugin_postinst')
     pkgs = []
 
     pkgs += do_split_packages(d, oe.path.join(rygel_libdir, "plugins"), 'librygel-(.*)\.so$', d.expand('${PN}-plugin-%s'), 'Rygel plugin for %s', postinst=postinst, extra_depends=d.expand('${PN}'))
     pkgs += do_split_packages(d, oe.path.join(rygel_libdir, "plugins"), '(.*)\.plugin$', d.expand('${PN}-plugin-%s'), 'Rygel plugin for %s', postinst=postinst, extra_depends=d.expand('${PN}'))
 
-    metapkg = d.getVar('PN', True) + '-meta'
+    metapkg = d.getVar('PN') + '-meta'
     d.setVar('RDEPENDS_' + metapkg, ' '.join(pkgs))
 }
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/dvb-apps/dvb-apps_1.1.1.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/dvb-apps/dvb-apps_1.1.1.bb
index 0b4b72d..4a7ed9a 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/dvb-apps/dvb-apps_1.1.1.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/dvb-apps/dvb-apps_1.1.1.bb
@@ -132,3 +132,5 @@
 RDEPENDS_dvb-apps =+ "libdvbapi libdvbcfg libdvbsec libdvben50221 libucsi"
 RDEPENDS_dvb-femon =+ "libdvbapi"
 RDEPENDS_dvbnet =+ "libdvbapi"
+
+PNBLACKLIST[dvb-apps] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/130603/ - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-Fix-checks-for-sse2-mmx.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-Fix-checks-for-sse2-mmx.patch
new file mode 100644
index 0000000..3283a5b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-Fix-checks-for-sse2-mmx.patch
@@ -0,0 +1,40 @@
+From f0dab6d6fe4b0aae4394eee93be86e9747c6ed5c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 22 Nov 2016 05:07:38 +0000
+Subject: [PATCH] Fix checks for sse2/mmx
+
+Just checking for cmdline options is not enough
+its better to check for builtin defines to be
+sure, clang does not error out on sse2 options on
+arm e.g. and it ends up doing SSE2 stuff for arm
+which is not desired
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 47d2cf2..4be000c 100755
+--- a/configure
++++ b/configure
+@@ -118,8 +118,14 @@ fi
+ # Valiate compiler
+ check_cc || die 'No C compiler found'
+ check_cc_header execinfo
+-check_cc_option mmx
+-check_cc_option sse2
++check_cc_snippet mmx '#ifndef __MMX__
++error "MMX not supported"
++#endif
++'
++check_cc_snippet sse2 '#ifndef __SSE2__
++error "SSE2 not supported"
++#endif
++'
+ 
+ if check_cc '
+ #if !defined(__clang__)
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-Makefile-Ignore-warning-about-wrong-includes.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-Makefile-Ignore-warning-about-wrong-includes.patch
new file mode 100644
index 0000000..248a5e6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-Makefile-Ignore-warning-about-wrong-includes.patch
@@ -0,0 +1,31 @@
+From 7d672305c7ad2f716dfe1c487b525a1a92954d4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 22 Nov 2016 06:22:36 +0000
+Subject: [PATCH] Makefile: Ignore warning about wrong includes
+
+It happens on musl especially
+usr/include/sys/poll.h:1:2: error: redirecting incorrect #include <sys/poll.h> to <poll.h> [-Werror,-W#warnings]
+| #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
+|  ^
+| In file included from src/avahi.c:48:
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile b/Makefile
+index f41ef1a..cc7b249 100644
+--- a/Makefile
++++ b/Makefile
+@@ -54,6 +54,7 @@ CFLAGS  += -Wno-microsoft -Qunused-arguments -Wno-unused-function
+ CFLAGS  += -Wno-unused-value -Wno-tautological-constant-out-of-range-compare
+ CFLAGS  += -Wno-parentheses-equality -Wno-incompatible-pointer-types
+ CFLAGS  += -Wno-error=varargs
++CFLAGS  += -Wno-error=\#warnings
+ endif
+ 
+ ifeq ($(CONFIG_LIBFFMPEG_STATIC),yes)
+-- 
+1.8.3.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-Move-tvheadend-specific-LD-CFLAGS-into-a-helper-vari.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-Move-tvheadend-specific-LD-CFLAGS-into-a-helper-vari.patch
deleted file mode 100644
index 9dfcce0..0000000
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-Move-tvheadend-specific-LD-CFLAGS-into-a-helper-vari.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-From 2ee64b359464b48f751683faa5ded3ee8200fe90 Mon Sep 17 00:00:00 2001
-From: Koen Kooi <koen@dominion.thruhere.net>
-Date: Fri, 21 Dec 2012 10:15:42 +0100
-Subject: [PATCH] Move tvheadend specific LD/CFLAGS into a helper variable to
- avoid being overwritten
-
-Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
-
-Upstream-Status: Inappropriate [OE specific]
----
- Makefile              |   20 ++++++++++----------
- support/configure.inc |    8 ++++----
- 2 files changed, 14 insertions(+), 14 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 8c6b293..daf5f14 100644
---- a/Makefile
-+++ b/Makefile
-@@ -27,12 +27,12 @@ PROG = ${BUILDDIR}/tvheadend
- # Common compiler flags
- #
- 
--CFLAGS  += -Wall -Werror -Wwrite-strings -Wno-deprecated-declarations
--CFLAGS  += -Wmissing-prototypes -fms-extensions
--CFLAGS  += -g -funsigned-char -O2 
--CFLAGS  += -D_FILE_OFFSET_BITS=64
--CFLAGS  += -I${BUILDDIR} -I${CURDIR}/src -I${CURDIR}
--LDFLAGS += -lrt -ldl -lpthread -lm
-+TVH_CFLAGS  += -Wall -Werror -Wwrite-strings -Wno-deprecated-declarations
-+TVH_CFLAGS  += -Wmissing-prototypes -fms-extensions
-+TVH_CFLAGS  += -g -funsigned-char -O2 
-+TVH_CFLAGS  += -D_FILE_OFFSET_BITS=64
-+TVH_CFLAGS  += -I${BUILDDIR} -I${CURDIR}/src -I${CURDIR}
-+TVH_LDFLAGS += -lrt -ldl -lpthread -lm
- 
- #
- # Other config
-@@ -179,8 +179,8 @@ SRCS-${CONFIG_CWC}  += src/ffdecsa/ffdecsa_interface.c \
- 	src/ffdecsa/ffdecsa_int.c
- SRCS-${CONFIG_MMX}  += src/ffdecsa/ffdecsa_mmx.c
- SRCS-${CONFIG_SSE2} += src/ffdecsa/ffdecsa_sse2.c
--${BUILDDIR}/src/ffdecsa/ffdecsa_mmx.o  : CFLAGS += -mmmx
--${BUILDDIR}/src/ffdecsa/ffdecsa_sse2.o : CFLAGS += -msse2
-+${BUILDDIR}/src/ffdecsa/ffdecsa_mmx.o  : TVH_CFLAGS += -mmmx
-+${BUILDDIR}/src/ffdecsa/ffdecsa_sse2.o : TVH_CFLAGS += -msse2
- endif
- 
- # File bundles
-@@ -217,12 +217,12 @@ all: ${PROG}
- 
- # Binary
- ${PROG}: $(OBJS) $(ALLDEPS)
--	$(CC) -o $@ $(OBJS) $(CFLAGS) $(LDFLAGS)
-+	$(CC) -o $@ $(OBJS) $(TVH_CFLAGS) $(TVH_LDFLAGS) $(CFLAGS) $(LDFLAGS)
- 
- # Object
- ${BUILDDIR}/%.o: %.c
- 	@mkdir -p $(dir $@)
--	$(CC) -MD -MP $(CFLAGS) -c -o $@ $(CURDIR)/$<
-+	$(CC) -MD -MP $(TVH_CFLAGS) $(CFLAGS) -c -o $@ $(CURDIR)/$<
- 
- # Add-on
- ${BUILDDIR}/%.so: ${SRCS_EXTRA}
-diff --git a/support/configure.inc b/support/configure.inc
-index 0130880..332511e 100644
---- a/support/configure.inc
-+++ b/support/configure.inc
-@@ -464,8 +464,8 @@ ifeq (\$(origin CC),default)
- CC        = ${CC}
- endif
- PYTHON   ?= ${PYTHON}
--CFLAGS   += ${CFLAGS}
--LDFLAGS  += ${LDFLAGS}
-+TVH_CFLAGS   += ${CFLAGS}
-+TVH_LDFLAGS  += ${LDFLAGS}
- prefix    = ${prefix}
- bindir    = ${bindir}
- mandir    = ${mandir}
-@@ -482,8 +482,8 @@ EOF
-   # Add package config
-   for pkg in ${PACKAGES[*]}; do
-     cat >>${CONFIG_MK} <<EOF
--LDFLAGS += $(pkg-config --libs $pkg)
--CFLAGS  += $(pkg-config --cflags $pkg)
-+TVH_LDFLAGS += $(pkg-config --libs $pkg)
-+TVH_CFLAGS  += $(pkg-config --cflags $pkg)
- EOF
-   done
- 
--- 
-1.7.7.6
-
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-disable-varargs-warning-on-clang.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-disable-varargs-warning-on-clang.patch
new file mode 100644
index 0000000..a4c4c4d
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-disable-varargs-warning-on-clang.patch
@@ -0,0 +1,32 @@
+From 906d95695af95970bf551ea55b6c3e70332c6b97 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 22 Nov 2016 05:22:32 +0000
+Subject: [PATCH] disable varargs warning on clang
+
+The issue is that 'len' is an unsigned char and we violate the promotion rules
+for passing the value to va_start.
+
+passing an object that undergoes defau
+lt argument promotion to 'va_start' has undefined behavior [-Wvarargs]
+|   va_start(ap, len);
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile b/Makefile
+index 8c5e380..f41ef1a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -53,6 +53,7 @@ ifeq ($(COMPILER), clang)
+ CFLAGS  += -Wno-microsoft -Qunused-arguments -Wno-unused-function
+ CFLAGS  += -Wno-unused-value -Wno-tautological-constant-out-of-range-compare
+ CFLAGS  += -Wno-parentheses-equality -Wno-incompatible-pointer-types
++CFLAGS  += -Wno-error=varargs
+ endif
+ 
+ ifeq ($(CONFIG_LIBFFMPEG_STATIC),yes)
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-dvr-Use-labs-instead-of-abs.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-dvr-Use-labs-instead-of-abs.patch
new file mode 100644
index 0000000..ea34cdb
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-dvr-Use-labs-instead-of-abs.patch
@@ -0,0 +1,37 @@
+From a715671eadcbf989fdaf05f62e71b93ac1749615 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 22 Nov 2016 06:08:31 +0000
+Subject: [PATCH] dvr: Use labs() instead of abs()
+
+Makes clang happy
+
+dvr/dvr_db.c:853:10: error: absolute value function
+'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value]
+if ((abs(de->de_start - e->start) < 600) && (abs(de->de_stop - e->stop) < 600)) {
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/dvr/dvr_db.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/dvr/dvr_db.c b/src/dvr/dvr_db.c
+index 165caa6..5656569 100644
+--- a/src/dvr/dvr_db.c
++++ b/src/dvr/dvr_db.c
+@@ -414,11 +414,11 @@ dvr_entry_fuzzy_match(dvr_entry_t *de, epg_broadcast_t *e)
+   /* Wrong length (+/-20%) */
+   t1 = de->de_stop - de->de_start;
+   t2  = e->stop - e->start;
+-  if ( abs(t2 - t1) > (t1 / 5) )
++  if ( labs(t2 - t1) > (t1 / 5) )
+     return 0;
+ 
+   /* Outside of window */
+-  if (abs(e->start - de->de_start) > de->de_config->dvr_update_window)
++  if (labs(e->start - de->de_start) > de->de_config->dvr_update_window)
+     return 0;
+   
+   /* Title match (or contains?) */
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-hdhomerun-Override-forced-overrdiing-og-CC-STRIP-and.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-hdhomerun-Override-forced-overrdiing-og-CC-STRIP-and.patch
new file mode 100644
index 0000000..484e723
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0001-hdhomerun-Override-forced-overrdiing-og-CC-STRIP-and.patch
@@ -0,0 +1,40 @@
+From c3767e189e90965407937b6178adbbd8cdafe31d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 22 Nov 2016 05:59:10 +0000
+Subject: [PATCH] hdhomerun: Override forced overrdiing og CC/STRIP and CFLAGS
+
+This is required for cross compiling otherwise it ends up
+using build host gcc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.hdhomerun | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.hdhomerun b/Makefile.hdhomerun
+index 943ffec..8bd14ff 100644
+--- a/Makefile.hdhomerun
++++ b/Makefile.hdhomerun
+@@ -18,8 +18,8 @@
+ 
+ include $(dir $(lastword $(MAKEFILE_LIST))).config.mk
+ 
+-unexport CFLAGS
+-unexport LDFLAGS
++#unexport CFLAGS
++#unexport LDFLAGS
+ 
+ define DOWNLOAD
+ 	@mkdir -p $(LIBHDHRDIR)/build
+@@ -75,6 +75,8 @@ $(LIBHDHRDIR)/$(LIBHDHR)/.tvh_download:
+ 	$(call DOWNLOAD,$(LIBHDHR_URL),$(LIBHDHRDIR)/$(LIBHDHR_TB),$(LIBHDHR_SHA1))
+ 	$(call UNTAR,$(LIBHDHR_TB),z)
+ 	ln -sf libhdhomerun $(LIBHDHRDIR)/$(LIBHDHR)
++	@sed -i -e "s/CC.*:=/CC ?=/" $(LIBHDHRDIR)/$(LIBHDHR)/Makefile
++	@sed -i -e "s/STRIP.*:=/STRIP ?=/" $(LIBHDHRDIR)/$(LIBHDHR)/Makefile
+ 	@touch $@
+ 
+ $(LIBHDHRDIR)/$(LIBHDHR)/.tvh_build: \
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0002-fix-issues-with-gcc6.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0002-fix-issues-with-gcc6.patch
deleted file mode 100644
index 55b9249..0000000
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend/0002-fix-issues-with-gcc6.patch
+++ /dev/null
@@ -1,46 +0,0 @@
---- git/src/htsmsg.c.orig	2016-06-17 11:47:53.026921237 -0400
-+++ git/src/htsmsg.c	2016-06-17 11:49:03.086922457 -0400
-@@ -574,13 +574,13 @@
-     case HMF_MAP:
-       printf("MAP) = {\n");
-       htsmsg_print0(&f->hmf_msg, indent + 1);
--      for(i = 0; i < indent; i++) printf("\t"); printf("}\n");
-+      for(i = 0; i < indent; i++) {printf("\t");} printf("}\n");
-       break;
- 
-     case HMF_LIST:
-       printf("LIST) = {\n");
-       htsmsg_print0(&f->hmf_msg, indent + 1);
--      for(i = 0; i < indent; i++) printf("\t"); printf("}\n");
-+      for(i = 0; i < indent; i++) {printf("\t");} printf("}\n");
-       break;
-       
-     case HMF_STR:
---- git/src/dvb/dvb_tables.c.orig	2016-06-17 11:51:09.142924652 -0400
-+++ git/src/dvb/dvb_tables.c	2016-06-17 11:54:33.962928219 -0400
-@@ -935,10 +935,10 @@
-     onid = (ptr[24] << 8) | ptr[25];
-     
-     /* Search all muxes on adapter */
--    LIST_FOREACH(tdmi, &tda->tda_muxes, tdmi_adapter_link)
--      if(tdmi->tdmi_transport_stream_id == tsid && tdmi->tdmi_network_id == onid);
--	break;
--    
-+    LIST_FOREACH(tdmi, &tda->tda_muxes, tdmi_adapter_link) {
-+      if(tdmi->tdmi_transport_stream_id == tsid && tdmi->tdmi_network_id == onid)
-+    	break;
-+    }
-     if(tdmi == NULL)
-       continue;
- 
---- git/src/epggrab/module/eit.c.orig	2016-06-17 11:49:57.726923409 -0400
-+++ git/src/epggrab/module/eit.c	2016-06-17 11:50:14.526923701 -0400
-@@ -214,7 +214,7 @@
-   if (m && m->enabled) cptr = _eit_freesat_conv;
-   else
-     m = epggrab_module_find_by_id("uk_freeview");
--    if (m && m->enabled) cptr = _eit_freesat_conv;
-+  if (m && m->enabled) cptr = _eit_freesat_conv;
- 
-   /* Convert */
-   return dvb_get_string_with_len(dst, dstlen, src, srclen, charset, cptr);
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend_git.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend_git.bb
index bd5062c..3b73549 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend_git.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-dvb/tvheadend/tvheadend_git.bb
@@ -1,22 +1,29 @@
 SUMMARY = "Tvheadend TV streaming server"
 HOMEPAGE = "https://www.lonelycoder.com/redmine/projects/tvheadend"
 
-DEPENDS = "avahi zlib openssl python-native"
+DEPENDS = "avahi zlib openssl python-native dvb-apps"
 
 LICENSE = "GPLv3+"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=9eef91148a9b14ec7f9df333daebc746"
+LIC_FILES_CHKSUM = "file://LICENSE.md;md5=9cae5acac2e9ee2fc3aec01ac88ce5db"
 
-SRC_URI = "git://github.com/tvheadend/tvheadend.git \
-           file://0001-Move-tvheadend-specific-LD-CFLAGS-into-a-helper-vari.patch \
-           file://0002-fix-issues-with-gcc6.patch \
+SRC_URI = "git://github.com/tvheadend/tvheadend.git;branch=release/4.0 \
+           file://0001-Fix-checks-for-sse2-mmx.patch \
+           file://0001-disable-varargs-warning-on-clang.patch \
+           file://0001-hdhomerun-Override-forced-overrdiing-og-CC-STRIP-and.patch \
+           file://0001-dvr-Use-labs-instead-of-abs.patch \
+           file://0001-Makefile-Ignore-warning-about-wrong-includes.patch \
 "
-SRCREV = "a420c83a0e0d2c31c2c15d0fec6fedc3f5a36dfe"
-PV = "3.3"
+SRCREV = "64fec8120158de585e18be705055259484518d94"
+PV = "4.0.9+git${SRCREV}"
 
 S = "${WORKDIR}/git"
 
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[uriparser] = "--enable-uriparser,--disable-uriparser,uriparser"
+
 do_configure() {
-    ./configure --prefix=${prefix} \
+    ./configure ${PACKAGECONFIG_CONFARGS} \
+                --prefix=${prefix} \
                 --libdir=${libdir} \
                 --bindir=${bindir} \
                 --datadir=${datadir} \
@@ -30,3 +37,7 @@
 }
 
 FILES_${PN} += "${datadir}/${BPN}"
+
+RDEPENDS_${PN} += "libdvben50221 libucsi libdvbapi"
+
+PNBLACKLIST[tvheadend] ?= "Depends on blacklisted dvb-apps - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/jsonschemabuilder-native.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/jsonschemabuilder-native.bb
new file mode 100644
index 0000000..fdb7699
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/jsonschemabuilder-native.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Kodi Media Center"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://JsonSchemaBuilder.cpp;beginline=2;endline=18;md5=1f67721215c03f66545390f6e45b99c7"
+
+SRCREV = "661dd08d221f5b2bf509a696a6aca5ee7d45bb27"
+
+PV = "17.1+gitr${SRCPV}"
+SRC_URI = "git://github.com/xbmc/xbmc.git;branch=Krypton"
+
+inherit autotools-brokensep gettext native
+
+S = "${WORKDIR}/git/tools/depends/native/JsonSchemaBuilder/src"
+
+do_compile_prepend() {
+    for i in $(find . -name "Makefile") ; do
+        sed -i -e 's:I/usr/include:I${STAGING_INCDIR}:g' $i
+    done
+
+    for i in $(find . -name "*.mak*" -o    -name "Makefile") ; do
+        sed -i -e 's:I/usr/include:I${STAGING_INCDIR}:g' -e 's:-rpath \$(libdir):-rpath ${libdir}:g' $i
+    done
+}
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0001-Fix-file_Emu-on-musl.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0001-Fix-file_Emu-on-musl.patch
new file mode 100644
index 0000000..20b6377
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0001-Fix-file_Emu-on-musl.patch
@@ -0,0 +1,496 @@
+From 7ae4fcf290ffb0b76374efafeaee575456ac9023 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 6 Nov 2016 23:08:27 -0800
+Subject: [PATCH 01/10] Fix file_Emu on musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ xbmc/cores/DllLoader/exports/emu_msvcrt.cpp        |  28 ++--
+ xbmc/cores/DllLoader/exports/emu_msvcrt.h          |   2 +-
+ .../DllLoader/exports/util/EmuFileWrapper.cpp      | 172 +++++++++------------
+ xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h |  27 ++--
+ xbmc/cores/DllLoader/exports/wrapper.c             |   4 +-
+ 5 files changed, 99 insertions(+), 134 deletions(-)
+
+diff --git a/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp b/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
+index ab14942..a39014a 100644
+--- a/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
++++ b/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
+@@ -51,6 +51,7 @@
+ #include <fcntl.h>
+ #include <time.h>
+ #include <signal.h>
++#include <paths.h>
+ #ifdef TARGET_POSIX
+ #include "PlatformDefs.h" // for __stat64
+ #include "XFileUtils.h"
+@@ -476,13 +477,10 @@ extern "C"
+     EmuFileObject* o = g_emuFileWrapper.GetFileObjectByDescriptor(fd);
+     if (o)
+     {
+-      if(!o->used)
+-        return NULL;
+-
+       int nmode = convert_fmode(mode);
+       if( (o->mode & nmode) != nmode)
+         CLog::Log(LOGWARNING, "dll_fdopen - mode 0x%x differs from fd mode 0x%x", nmode, o->mode);
+-      return &o->file_emu;
++      return g_emuFileWrapper.GetStreamByFileObject(o);
+     }
+     else if (!IS_STD_DESCRIPTOR(fd))
+     {
+@@ -545,7 +543,7 @@ extern "C"
+         return -1;
+       }
+       object->mode = iMode;
+-      return g_emuFileWrapper.GetDescriptorByStream(&object->file_emu);
++      return g_emuFileWrapper.GetDescriptorByFileObject(object);
+     }
+     delete pFile;
+     return -1;
+@@ -1214,8 +1212,8 @@ extern "C"
+   {
+     FILE* file = NULL;
+ #if defined(TARGET_LINUX) && !defined(TARGET_ANDROID)
+-    if (strcmp(filename, MOUNTED) == 0
+-    ||  strcmp(filename, MNTTAB) == 0)
++    if (strcmp(filename, _PATH_MOUNTED) == 0
++    ||  strcmp(filename, _PATH_MNTTAB) == 0)
+     {
+       CLog::Log(LOGINFO, "%s - something opened the mount file, let's hope it knows what it's doing", __FUNCTION__);
+       return fopen(filename, mode);
+@@ -1622,7 +1620,7 @@ extern "C"
+     int ret;
+ 
+     ret = dll_fgetpos64(stream, &tmpPos);
+-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
++#if !defined(__GLIBC__) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
+     *pos = (fpos_t)tmpPos;
+ #else
+     pos->__pos = (off_t)tmpPos.__pos;
+@@ -1635,8 +1633,9 @@ extern "C"
+     CFile* pFile = g_emuFileWrapper.GetFileXbmcByStream(stream);
+     if (pFile != NULL)
+     {
+-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
+-      *pos = pFile->GetPosition();
++#if !defined(__GLIBC__) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
++      uint64_t *ppos = (uint64_t *) pos;
++      *ppos = pFile->GetPosition();
+ #else
+       pos->__pos = pFile->GetPosition();
+ #endif
+@@ -1657,8 +1656,9 @@ extern "C"
+     int fd = g_emuFileWrapper.GetDescriptorByStream(stream);
+     if (fd >= 0)
+     {
+-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
+-      if (dll_lseeki64(fd, *pos, SEEK_SET) >= 0)
++#if !defined(__GLIBC__) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
++      const uint64_t *ppos = (const uint64_t *) pos;
++      if (dll_lseeki64(fd, *ppos, SEEK_SET) >= 0)
+ #else
+       if (dll_lseeki64(fd, (__off64_t)pos->__pos, SEEK_SET) >= 0)
+ #endif
+@@ -1674,7 +1674,7 @@ extern "C"
+     {
+       // it might be something else than a file, or the file is not emulated
+       // let the operating system handle it
+-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
++#if !defined(__GLIBC__) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
+       return fsetpos(stream, pos);
+ #else
+       return fsetpos64(stream, pos);
+@@ -1690,7 +1690,7 @@ extern "C"
+     if (fd >= 0)
+     {
+       fpos64_t tmpPos;
+-#if !defined(TARGET_POSIX) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
++#if !defined(__GLIBC__) || defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
+       tmpPos= *pos;
+ #else
+       tmpPos.__pos = (off64_t)(pos->__pos);
+diff --git a/xbmc/cores/DllLoader/exports/emu_msvcrt.h b/xbmc/cores/DllLoader/exports/emu_msvcrt.h
+index 3294d9a..c7c483f 100644
+--- a/xbmc/cores/DllLoader/exports/emu_msvcrt.h
++++ b/xbmc/cores/DllLoader/exports/emu_msvcrt.h
+@@ -24,7 +24,7 @@
+ #define _onexit_t void*
+ #endif
+ 
+-#if defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
++#if defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) || !defined(__GLIBC__)
+ typedef off_t __off_t;
+ typedef int64_t off64_t;
+ typedef off64_t __off64_t;
+diff --git a/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.cpp b/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.cpp
+index 8927d41..e9a2ab0 100644
+--- a/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.cpp
++++ b/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.cpp
+@@ -52,16 +52,7 @@ constexpr bool isValidFilePtr(FILE* f)
+ }
+ CEmuFileWrapper::CEmuFileWrapper()
+ {
+-  // since we always use dlls we might just initialize it directly
+-  for (int i = 0; i < MAX_EMULATED_FILES; i++)
+-  {
+-    memset(&m_files[i], 0, sizeof(EmuFileObject));
+-    m_files[i].used = false;
+-#if defined(TARGET_WINDOWS) && (_MSC_VER >= 1900)
+-    m_files[i].file_emu._Placeholder = new kodi_iobuf();
+-#endif
+-    FileDescriptor(m_files[i].file_emu)->_file = -1;
+-  }
++  memset(m_files, 0, sizeof(m_files));
+ }
+ 
+ CEmuFileWrapper::~CEmuFileWrapper()
+@@ -73,29 +64,7 @@ void CEmuFileWrapper::CleanUp()
+ {
+   CSingleLock lock(m_criticalSection);
+   for (int i = 0; i < MAX_EMULATED_FILES; i++)
+-  {
+-    if (m_files[i].used)
+-    {
+-      m_files[i].file_xbmc->Close();
+-      delete m_files[i].file_xbmc;
+-
+-      if (m_files[i].file_lock)
+-      {
+-        delete m_files[i].file_lock;
+-        m_files[i].file_lock = nullptr;
+-      }
+-#if !defined(TARGET_WINDOWS)
+-      //Don't memset on Windows as it overwrites our pointer
+-      memset(&m_files[i], 0, sizeof(EmuFileObject));
+-#endif
+-      m_files[i].used = false;
+-      FileDescriptor(m_files[i].file_emu)->_file = -1;
+-    }
+-#if defined(TARGET_WINDOWS) && (_MSC_VER >= 1900)
+-    delete static_cast<kodi_iobuf*>(m_files[i].file_emu._Placeholder);
+-    m_files[i].file_emu._Placeholder = nullptr;
+-#endif
+-  }
++    UnRegisterFileObject(&m_files[i], true);
+ }
+ 
+ EmuFileObject* CEmuFileWrapper::RegisterFileObject(XFILE::CFile* pFile)
+@@ -106,13 +75,11 @@ EmuFileObject* CEmuFileWrapper::RegisterFileObject(XFILE::CFile* pFile)
+ 
+   for (int i = 0; i < MAX_EMULATED_FILES; i++)
+   {
+-    if (!m_files[i].used)
++    if (!m_files[i].file_xbmc)
+     {
+       // found a free location
+       object = &m_files[i];
+-      object->used = true;
+       object->file_xbmc = pFile;
+-      FileDescriptor(object->file_emu)->_file = (i + FILE_WRAPPER_OFFSET);
+       object->file_lock = new CCriticalSection();
+       break;
+     }
+@@ -121,82 +88,74 @@ EmuFileObject* CEmuFileWrapper::RegisterFileObject(XFILE::CFile* pFile)
+   return object;
+ }
+ 
+-void CEmuFileWrapper::UnRegisterFileObjectByDescriptor(int fd)
++void CEmuFileWrapper::UnRegisterFileObject(EmuFileObject *object, bool free_file)
++
+ {
+-  int i = fd - FILE_WRAPPER_OFFSET;
+-  if (! (i >= 0 && i < MAX_EMULATED_FILES))
+-    return;
++  if (object && object->file_xbmc)
++  {
++    if (object->file_xbmc && free_file)
++    {
++      object->file_xbmc->Close();
++      delete object->file_xbmc;
++    }
++    if (object->file_lock)
++    {
++      delete object->file_lock;
++    }
+ 
+-  if (!m_files[i].used)
+-    return;
++    memset(object, 0, sizeof(*object));
++   }
++}
+ 
++void CEmuFileWrapper::UnRegisterFileObjectByDescriptor(int fd)
++{
+   CSingleLock lock(m_criticalSection);
+-
+-  // we assume the emulated function alreay deleted the CFile object
+-  if (m_files[i].file_lock)
+-  {
+-    delete m_files[i].file_lock;
+-    m_files[i].file_lock = nullptr;
+-  }
+-#if !defined(TARGET_WINDOWS)
+-  //Don't memset on Windows as it overwrites our pointer
+-  memset(&m_files[i], 0, sizeof(EmuFileObject));
+-#endif
+-  m_files[i].used = false;
+-  FileDescriptor(m_files[i].file_emu)->_file = -1;
++  UnRegisterFileObject(GetFileObjectByDescriptor(fd), false);
+ }
+ 
+ void CEmuFileWrapper::UnRegisterFileObjectByStream(FILE* stream)
+ {
+   if (isValidFilePtr(stream))
+   {
+-    return UnRegisterFileObjectByDescriptor(FileDescriptor(*stream)->_file);
++    CSingleLock lock(m_criticalSection);
++    UnRegisterFileObject(GetFileObjectByStream(stream), false);
+   }
+ }
+ 
+ void CEmuFileWrapper::LockFileObjectByDescriptor(int fd)
+ {
+-  int i = fd - FILE_WRAPPER_OFFSET;
+-  if (i >= 0 && i < MAX_EMULATED_FILES)
++  EmuFileObject* object = GetFileObjectByDescriptor(fd);
++  if (object && object->file_xbmc)
+   {
+-    if (m_files[i].used)
+-    {
+-      m_files[i].file_lock->lock();
+-    }
++    object->file_lock->lock();
+   }
+ }
+ 
+ bool CEmuFileWrapper::TryLockFileObjectByDescriptor(int fd)
+ {
+-  int i = fd - FILE_WRAPPER_OFFSET;
+-  if (i >= 0 && i < MAX_EMULATED_FILES)
++  EmuFileObject* object = GetFileObjectByDescriptor(fd);
++  if (object && object->file_xbmc)
+   {
+-    if (m_files[i].used)
+-    {
+-      return m_files[i].file_lock->try_lock();
+-    }
++    return object->file_lock->try_lock();
+   }
+   return false;
+ }
+ 
+ void CEmuFileWrapper::UnlockFileObjectByDescriptor(int fd)
+ {
+-  int i = fd - FILE_WRAPPER_OFFSET;
+-  if (i >= 0 && i < MAX_EMULATED_FILES)
++  EmuFileObject* object = GetFileObjectByDescriptor(fd);
++  if (object && object->file_xbmc)
+   {
+-    if (m_files[i].used)
+-    {
+-      m_files[i].file_lock->unlock();
+-    }
++    object->file_lock->unlock();
+   }
+ }
+ 
+ EmuFileObject* CEmuFileWrapper::GetFileObjectByDescriptor(int fd)
+ {
+-  int i = fd - FILE_WRAPPER_OFFSET;
++  int i = fd - 0x7000000;
+   if (i >= 0 && i < MAX_EMULATED_FILES)
+   {
+-    if (m_files[i].used)
++    if (m_files[i].file_xbmc)
+     {
+       return &m_files[i];
+     }
+@@ -204,20 +163,39 @@ EmuFileObject* CEmuFileWrapper::GetFileObjectByDescriptor(int fd)
+   return nullptr;
+ }
+ 
++int CEmuFileWrapper::GetDescriptorByFileObject(EmuFileObject *object)
++{
++  int i = object - m_files;
++  if (i >= 0 && i < MAX_EMULATED_FILES)
++  {
++    return 0x7000000 + i;
++  }
++
++  return -1;
++}
++
+ EmuFileObject* CEmuFileWrapper::GetFileObjectByStream(FILE* stream)
+ {
+-  if (isValidFilePtr(stream))
++  EmuFileObject *object = (EmuFileObject*) stream;
++  if (object >= &m_files[0] || object < &m_files[MAX_EMULATED_FILES])
+   {
+-    return GetFileObjectByDescriptor(FileDescriptor(*stream)->_file);
++    if (object->file_xbmc)
++    {
++      return object;
++    }
+   }
++  return NULL;
++}
+ 
+-  return nullptr;
++FILE* CEmuFileWrapper::GetStreamByFileObject(EmuFileObject *object)
++{
++  return (FILE*) object;
+ }
+ 
+ XFILE::CFile* CEmuFileWrapper::GetFileXbmcByDescriptor(int fd)
+ {
+   auto object = GetFileObjectByDescriptor(fd);
+-  if (object != nullptr && object->used)
++  if (object != nullptr)
+   {
+     return object->file_xbmc;
+   }
+@@ -228,8 +206,9 @@ XFILE::CFile* CEmuFileWrapper::GetFileXbmcByStream(FILE* stream)
+ {
+   if (isValidFilePtr(stream))
+   {
+-    auto object = GetFileObjectByDescriptor(FileDescriptor(*stream)->_file);
+-    if (object != nullptr && object->used)
++    EmuFileObject* object = GetFileObjectByStream(stream);
++    if (object != NULL)
++
+     {
+       return object->file_xbmc;
+     }
+@@ -239,32 +218,21 @@ XFILE::CFile* CEmuFileWrapper::GetFileXbmcByStream(FILE* stream)
+ 
+ int CEmuFileWrapper::GetDescriptorByStream(FILE* stream)
+ {
+-  if (isValidFilePtr(stream))
+-  {
+-    int i = FileDescriptor(*stream)->_file - FILE_WRAPPER_OFFSET;
+-    if (i >= 0 && i < MAX_EMULATED_FILES)
+-    {
+-      return i + FILE_WRAPPER_OFFSET;
+-    }
+-  }
+-  return -1;
++  return GetDescriptorByFileObject(GetFileObjectByStream(stream));
+ }
+ 
+ FILE* CEmuFileWrapper::GetStreamByDescriptor(int fd)
+ {
+-  auto object = GetFileObjectByDescriptor(fd);
+-  if (object != nullptr && object->used)
+-  {
+-    return &object->file_emu;
+-  }
+-  return nullptr;
++  return GetStreamByFileObject(GetFileObjectByDescriptor(fd));
++}
++
++bool CEmuFileWrapper::DescriptorIsEmulatedFile(int fd)
++{
++  return GetFileObjectByDescriptor(fd) != NULL;
+ }
+ 
+ bool CEmuFileWrapper::StreamIsEmulatedFile(FILE* stream)
+ {
+-  if (isValidFilePtr(stream))
+-  {
+-    return DescriptorIsEmulatedFile(FileDescriptor(*stream)->_file);
+-  }
+-  return false;
++  return GetFileObjectByStream(stream) != NULL;
+ }
++
+diff --git a/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h b/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h
+index 786fa85..311a5cf 100644
+--- a/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h
++++ b/xbmc/cores/DllLoader/exports/util/EmuFileWrapper.h
+@@ -25,14 +25,14 @@
+ #include "system.h"
+ #include "threads/CriticalSection.h"
+ 
+-#if defined(TARGET_POSIX) && !defined(TARGET_DARWIN) && !defined(TARGET_FREEBSD) && !defined(TARGET_ANDROID) && !defined(__UCLIBC__)
+-#define _file _fileno
+-#elif defined(__UCLIBC__)
+-#define _file __filedes
+-#endif
++//#if defined(TARGET_POSIX) && !defined(TARGET_DARWIN) && !defined(TARGET_FREEBSD) && !defined(TARGET_ANDROID) && !defined(__UCLIBC__)
++//#define _file _fileno
++//#elif defined(__UCLIBC__)
++//#define _file __filedes
++//#endif
+ 
+ #define MAX_EMULATED_FILES    50
+-#define FILE_WRAPPER_OFFSET   0x00000200
++//#define FILE_WRAPPER_OFFSET   0x00000200
+ 
+ namespace XFILE
+ {
+@@ -47,12 +47,9 @@ struct kodi_iobuf {
+ 
+ typedef struct stEmuFileObject
+ {
+-  FILE    file_emu;
+   XFILE::CFile*  file_xbmc;
+   CCriticalSection *file_lock;
+   int mode;
+-  //Stick this last to avoid 3-7 bytes of padding
+-  bool    used;
+ } EmuFileObject;
+ 
+ class CEmuFileWrapper
+@@ -67,22 +64,22 @@ public:
+   void CleanUp();
+ 
+   EmuFileObject* RegisterFileObject(XFILE::CFile* pFile);
++  void UnRegisterFileObject(EmuFileObject*, bool free_file);
+   void UnRegisterFileObjectByDescriptor(int fd);
+   void UnRegisterFileObjectByStream(FILE* stream);
+   void LockFileObjectByDescriptor(int fd);
+   bool TryLockFileObjectByDescriptor(int fd);
+   void UnlockFileObjectByDescriptor(int fd);
+   EmuFileObject* GetFileObjectByDescriptor(int fd);
++  int GetDescriptorByFileObject(EmuFileObject*);
+   EmuFileObject* GetFileObjectByStream(FILE* stream);
++  FILE* GetStreamByFileObject(EmuFileObject*);
+   XFILE::CFile* GetFileXbmcByDescriptor(int fd);
+   XFILE::CFile* GetFileXbmcByStream(FILE* stream);
+-  static int GetDescriptorByStream(FILE* stream);
++  int GetDescriptorByStream(FILE* stream);
+   FILE* GetStreamByDescriptor(int fd);
+-  static constexpr bool DescriptorIsEmulatedFile(int fd)
+-  {
+-    return fd >= FILE_WRAPPER_OFFSET && fd < FILE_WRAPPER_OFFSET + MAX_EMULATED_FILES;
+-  }
+-  static bool StreamIsEmulatedFile(FILE* stream);
++  bool DescriptorIsEmulatedFile(int fd);
++  bool StreamIsEmulatedFile(FILE* stream);
+ private:
+   EmuFileObject m_files[MAX_EMULATED_FILES];
+   CCriticalSection m_criticalSection;
+diff --git a/xbmc/cores/DllLoader/exports/wrapper.c b/xbmc/cores/DllLoader/exports/wrapper.c
+index e363662..07825f3 100644
+--- a/xbmc/cores/DllLoader/exports/wrapper.c
++++ b/xbmc/cores/DllLoader/exports/wrapper.c
+@@ -39,13 +39,13 @@
+ #endif
+ #include <dlfcn.h>
+ 
+-#if defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID)
++#if defined(TARGET_DARWIN) || defined(TARGET_FREEBSD) || defined(TARGET_ANDROID) || !defined(__GLIBC__)
+ typedef off_t     __off_t;
+ typedef int64_t   off64_t;
+ typedef off64_t   __off64_t;
+ typedef fpos_t    fpos64_t;
+ #define stat64    stat
+-#if defined(TARGET_DARWIN) || defined(TARGET_ANDROID)
++#if defined(TARGET_DARWIN) || defined(TARGET_ANDROID) || !defined(__GLIBC__)
+ #define _G_va_list va_list
+ #endif
+ #endif
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0001-change-order-of-detecting-libegl-and-libgles2.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0001-change-order-of-detecting-libegl-and-libgles2.patch
new file mode 100644
index 0000000..12a6c06
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0001-change-order-of-detecting-libegl-and-libgles2.patch
@@ -0,0 +1,32 @@
+From 21524598110e7a55113205dda4bc1a6d5987111c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 9 May 2017 06:41:33 +0000
+Subject: [PATCH] change order of detecting libegl and libgles2
+
+This actually helps building it on rpi/userland
+where libEGL depends on few functions from libGLESv2
+see
+https://www.raspberrypi.org/forums/viewtopic.php?t=7090
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index b9e4240..1ca0297 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -951,8 +951,8 @@ if test "$use_gles" = "yes"; then
+       AC_MSG_RESULT(== WARNING: OpenGLES support is assumed.)
+       LIBS="$LIBS -lEGL -lGLESv2 -lbcm_host -lvcos -lvchiq_arm -lmmal -lmmal_core -lmmal_util -lvcsm"
+     else
+-      AC_CHECK_LIB([EGL],   [main],, AC_MSG_ERROR($missing_library))
+       AC_CHECK_LIB([GLESv2],[main],, AC_MSG_ERROR($missing_library))
++      AC_CHECK_LIB([EGL],   [main],, AC_MSG_ERROR($missing_library))
+     fi
+   fi
+ else
+-- 
+1.9.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0002-Remove-FILEWRAP.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0002-Remove-FILEWRAP.patch
new file mode 100644
index 0000000..463a5c4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0002-Remove-FILEWRAP.patch
@@ -0,0 +1,46 @@
+From ad1977a358319093b305df6d84be6db676ef1e4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 6 Nov 2016 22:35:16 -0800
+Subject: [PATCH 02/10] Remove FILEWRAP
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ xbmc/utils/posix/PosixInterfaceForCLog.cpp | 6 +-----
+ xbmc/utils/posix/PosixInterfaceForCLog.h   | 4 +---
+ 2 files changed, 2 insertions(+), 8 deletions(-)
+
+Index: git/xbmc/utils/posix/PosixInterfaceForCLog.cpp
+===================================================================
+--- git.orig/xbmc/utils/posix/PosixInterfaceForCLog.cpp
++++ git/xbmc/utils/posix/PosixInterfaceForCLog.cpp
+@@ -29,10 +29,6 @@
+ #include "platform/android/activity/XBMCApp.h"
+ #endif // TARGET_ANDROID
+ 
+-struct FILEWRAP : public FILE
+-{};
+-
+-
+ CPosixInterfaceForCLog::CPosixInterfaceForCLog() :
+   m_file(NULL)
+ { }
+@@ -52,7 +48,7 @@ bool CPosixInterfaceForCLog::OpenLogFile
+   (void)remove(backupOldLogToFilename.c_str()); // if it's failed, try to continue
+   (void)rename(logFilename.c_str(), backupOldLogToFilename.c_str()); // if it's failed, try to continue
+ 
+-  m_file = (FILEWRAP*)fopen(logFilename.c_str(), "wb");
++  m_file = fopen(logFilename.c_str(), "wb");
+   if (!m_file)
+     return false; // error, can't open log file
+ 
+Index: git/xbmc/utils/posix/PosixInterfaceForCLog.h
+===================================================================
+--- git.orig/xbmc/utils/posix/PosixInterfaceForCLog.h
++++ git/xbmc/utils/posix/PosixInterfaceForCLog.h
+@@ -34,5 +34,5 @@ public:
+   void PrintDebugString(const std::string& debugString);
+   static void GetCurrentLocalTime(int& hour, int& minute, int& second, double& millisecond);
+ private:
+-  FILEWRAP* m_file;
++  FILE* m_file;
+ };
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0003-configure-don-t-try-to-run-stuff-to-find-tinyxml.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0003-configure-don-t-try-to-run-stuff-to-find-tinyxml.patch
new file mode 100644
index 0000000..49217a4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0003-configure-don-t-try-to-run-stuff-to-find-tinyxml.patch
@@ -0,0 +1,25 @@
+From a91a3ba229dc5903935f7dd98dd03bbb4fe5ac1f Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Sat, 6 Feb 2016 15:43:01 +0100
+Subject: [PATCH 03/10] configure: don't try to run stuff to find tinyxml
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 34fe643..3132dc1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1043,7 +1043,7 @@ fi
+ AC_LANG_PUSH([C++])
+ PKG_CHECK_MODULES([TINYXML], [tinyxml >= 2.6.2],
+   [INCLUDES="$INCLUDES $TINYXML_CFLAGS"; LIBS="$LIBS $TINYXML_LIBS"],
+-  [AC_RUN_IFELSE(
++  [AC_COMPILE_IFELSE(
+    [AC_LANG_SOURCE([[
+ #include <stdlib.h>
+ #include <tinyxml.h>
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0004-handle-SIGTERM.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0004-handle-SIGTERM.patch
new file mode 100644
index 0000000..dc37439
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0004-handle-SIGTERM.patch
@@ -0,0 +1,163 @@
+From 49046c1685465a5486fe9e1c04b99c585aab6862 Mon Sep 17 00:00:00 2001
+From: Stefan Saraev <stefan@saraev.ca>
+Date: Wed, 2 Nov 2016 11:28:34 -0700
+Subject: [PATCH 04/10] handle SIGTERM
+
+0. CApplication::Stop cant be trusted. (deadlocks crashes and boo)
+
+so, when shutdown/reboot is requested:
+
+1. save an exit code (for CEC...)
+2. call CPowerManager::{Reboot,PowerDown}
+3. ... then systemd sends TERM and waits xx seconds before sending KILL
+4. CApplication::Stop has xx seconds to save guisettings.xml and boo
+5. CEC thread has xx seconds to switch off after it received OnQuit
+6. addons / pvrmanager / cec / everything else.. are free to deadlock / crash now, we dont care
+7. KILL
+
+Signed-off-by: Stefan Saraev <stefan@saraev.ca>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ xbmc/Application.cpp         | 17 ++++++++++++-----
+ xbmc/Application.h           |  1 +
+ xbmc/XBApplicationEx.cpp     |  1 +
+ xbmc/XBApplicationEx.h       |  1 +
+ xbmc/platform/posix/main.cpp | 15 +++++++++++++++
+ 5 files changed, 30 insertions(+), 5 deletions(-)
+
+diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
+index 100a2f2..fda892d 100644
+--- a/xbmc/Application.cpp
++++ b/xbmc/Application.cpp
+@@ -2426,12 +2426,12 @@ void CApplication::OnApplicationMessage(ThreadMessage* pMsg)
+   switch (pMsg->dwMessage)
+   {
+   case TMSG_POWERDOWN:
+-    Stop(EXITCODE_POWERDOWN);
++    SetExitCode(EXITCODE_POWERDOWN);
+     g_powerManager.Powerdown();
+     break;
+ 
+   case TMSG_QUIT:
+-    Stop(EXITCODE_QUIT);
++    SetExitCode(EXITCODE_QUIT);
+     break;
+   
+   case TMSG_SHUTDOWN:
+@@ -2452,12 +2452,13 @@ void CApplication::OnApplicationMessage(ThreadMessage* pMsg)
+ 
+   case TMSG_RESTART:
+   case TMSG_RESET:
+-    Stop(EXITCODE_REBOOT);
++    SetExitCode(EXITCODE_REBOOT);
+     g_powerManager.Reboot();
+     break;
+ 
+   case TMSG_RESTARTAPP:
+ #if defined(TARGET_WINDOWS) || defined(TARGET_LINUX)
++    SetExitCode(EXITCODE_RESTARTAPP);
+     Stop(EXITCODE_RESTARTAPP);
+ #endif
+     break;
+@@ -2881,6 +2882,13 @@ bool CApplication::Cleanup()
+   }
+ }
+ 
++void CApplication::SetExitCode(int exitCode)
++{
++  // save it for CEC
++  m_ExitCode = exitCode;
++  m_ExitCodeSet = true;
++}
++
+ void CApplication::Stop(int exitCode)
+ {
+   try
+@@ -2888,7 +2896,7 @@ void CApplication::Stop(int exitCode)
+     m_frameMoveGuard.unlock();
+ 
+     CVariant vExitCode(CVariant::VariantTypeObject);
+-    vExitCode["exitcode"] = exitCode;
++    vExitCode["exitcode"] = m_ExitCode;
+     CAnnouncementManager::GetInstance().Announce(System, "xbmc", "OnQuit", vExitCode);
+ 
+     // Abort any active screensaver
+@@ -2922,7 +2930,6 @@ void CApplication::Stop(int exitCode)
+ 
+     m_bStop = true;
+     m_AppFocused = false;
+-    m_ExitCode = exitCode;
+     CLog::Log(LOGNOTICE, "stop all");
+ 
+     // cancel any jobs from the jobmanager
+diff --git a/xbmc/Application.h b/xbmc/Application.h
+index a9d9bf5..e536deb 100644
+--- a/xbmc/Application.h
++++ b/xbmc/Application.h
+@@ -159,6 +159,7 @@ public:
+   void StopPVRManager();
+   void ReinitPVRManager();
+   bool IsCurrentThread() const;
++  void SetExitCode(int exitCode);
+   void Stop(int exitCode);
+   void RestartApp();
+   void UnloadSkin(bool forReload = false);
+diff --git a/xbmc/XBApplicationEx.cpp b/xbmc/XBApplicationEx.cpp
+index 035aed2..34102f5 100644
+--- a/xbmc/XBApplicationEx.cpp
++++ b/xbmc/XBApplicationEx.cpp
+@@ -46,6 +46,7 @@ CXBApplicationEx::CXBApplicationEx()
+   m_bStop = false;
+   m_AppFocused = true;
+   m_ExitCode = EXITCODE_QUIT;
++  m_ExitCodeSet = false;
+   m_renderGUI = false;
+ }
+ 
+diff --git a/xbmc/XBApplicationEx.h b/xbmc/XBApplicationEx.h
+index 9bc14fa..f696b89 100644
+--- a/xbmc/XBApplicationEx.h
++++ b/xbmc/XBApplicationEx.h
+@@ -42,6 +42,7 @@ public:
+   // Variables for timing
+   bool m_bStop;
+   int  m_ExitCode;
++  bool m_ExitCodeSet;
+   bool m_AppFocused;
+   bool m_renderGUI;
+ 
+diff --git a/xbmc/platform/posix/main.cpp b/xbmc/platform/posix/main.cpp
+index a8b64e5..3d80032 100644
+--- a/xbmc/platform/posix/main.cpp
++++ b/xbmc/platform/posix/main.cpp
+@@ -41,12 +41,27 @@
+ #include "input/linux/LIRC.h"
+ #endif
+ #include "platform/XbmcContext.h"
++#include "Application.h"
++
++void xbmc_term_handler(int signum)
++{
++  CLog::Log(LOGINFO, "Received SIGTERM...");
++  if (!g_application.m_ExitCodeSet)
++    g_application.SetExitCode(EXITCODE_RESTARTAPP);
++  g_application.Stop(EXITCODE_RESTARTAPP);
++}
+ 
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+ int main(int argc, char* argv[])
+ {
++  // SIGTERM handler
++  struct sigaction action;
++  memset(&action, 0, sizeof(struct sigaction));
++  action.sa_handler = xbmc_term_handler;
++  sigaction(SIGTERM, &action, NULL);
++
+   // set up some xbmc specific relationships
+   XBMC::Context context;
+ 
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0005-add-support-to-read-frequency-output-if-using-intel-.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0005-add-support-to-read-frequency-output-if-using-intel-.patch
new file mode 100644
index 0000000..ee10c40
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0005-add-support-to-read-frequency-output-if-using-intel-.patch
@@ -0,0 +1,26 @@
+From 4d1368d20f04216aec9551d9845b305f96a21015 Mon Sep 17 00:00:00 2001
+From: Stephan Raue <stephan@openelec.tv>
+Date: Mon, 1 Sep 2014 03:16:37 +0200
+Subject: [PATCH 05/10] add support to read frequency output if using intel's
+ pstate driver
+
+---
+ xbmc/utils/CPUInfo.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/xbmc/utils/CPUInfo.cpp b/xbmc/utils/CPUInfo.cpp
+index 5e2ebbd..fd04d5a 100644
+--- a/xbmc/utils/CPUInfo.cpp
++++ b/xbmc/utils/CPUInfo.cpp
+@@ -274,6 +274,8 @@ CCPUInfo::CCPUInfo(void)
+     m_fProcTemperature = fopen("/sys/class/thermal/thermal_zone0/temp", "r");  // On Raspberry PIs
+ 
+   m_fCPUFreq = fopen ("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", "r");
++  if (m_fCPUFreq == NULL)
++    m_fCPUFreq = fopen ("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq", "r");
+   if (!m_fCPUFreq)
+   {
+     m_cpuInfoForFreq = true;
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0006-Disable-DVD-support.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0006-Disable-DVD-support.patch
new file mode 100644
index 0000000..08dfac3
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0006-Disable-DVD-support.patch
@@ -0,0 +1,35 @@
+From 3d3ec391038c6ee73897a7fab753b11b589de1ed Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 2 Nov 2016 12:39:20 -0700
+Subject: [PATCH 06/10] Disable DVD support
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.in | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 0d70e9b..050c7ca 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -10,8 +10,7 @@ EC_DIRS= \
+ 	tools/EventClients
+ 
+ DVDPCODECS_DIRS= \
+-	lib \
+-	lib/libdvd
++	lib
+ 
+ VideoPlayer_ARCHIVES=xbmc/cores/VideoPlayer/VideoPlayer.a \
+                    xbmc/cores/VideoPlayer/DVDCodecs/DVDCodecs.a \
+@@ -347,7 +346,6 @@ libaddon: exports
+ 	$(MAKE) -C lib/addons/library.xbmc.pvr
+ 	$(MAKE) -C lib/addons/library.kodi.inputstream
+ dvdpcodecs: dllloader
+-	$(MAKE) -C lib/libdvd
+ 
+ dvdpextcodecs:
+ 
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0007-Always-compile-libcpluff-as-PIC.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0007-Always-compile-libcpluff-as-PIC.patch
new file mode 100644
index 0000000..8fd7ece
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0007-Always-compile-libcpluff-as-PIC.patch
@@ -0,0 +1,30 @@
+From d989cbdb7686c3b95dc749967f89b93e47f955a6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 3 Nov 2016 13:10:00 -0700
+Subject: [PATCH 07/10] Always compile libcpluff as PIC
+
+Fixes errors e.g.
+
+ld: lib/cpluff/libcpluff/.libs/libcpluff.a(pcontrol.o): relocation R_X86_64_PC32 against symbol `cp_stop_plugins' can not be used when making a shared object; recompile with -fPIC
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 3132dc1..ab4eea3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2385,7 +2385,7 @@ XB_CONFIG_MODULE([lib/cpluff], [
+     --prefix="${prefix}" --includedir="${includedir}" --libdir="${libdir}" --datadir="${datadir}" \
+     --host=$host_alias \
+     --build=$build_alias \
+-    --target=$target_alias CFLAGS="$CFLAGS" CC="$CC" CXX="$CXX" LDFLAGS="$LDFLAGS" LIBS=""
++    --target=$target_alias --with-pic=yes CFLAGS="$CFLAGS" CC="$CC" CXX="$CXX" LDFLAGS="$LDFLAGS" LIBS=""
+     #LDFLAGS="$LDFLAGS -Wl,-read_only_relocs,suppress"
+ ], [0])
+ 
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0008-kodi-config.cmake-use-CMAKE_FIND_ROOT_PATH-to-fix-cr.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0008-kodi-config.cmake-use-CMAKE_FIND_ROOT_PATH-to-fix-cr.patch
new file mode 100644
index 0000000..9390144
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0008-kodi-config.cmake-use-CMAKE_FIND_ROOT_PATH-to-fix-cr.patch
@@ -0,0 +1,43 @@
+From 51cd8d5f084013360b29fe497193288ebde2f4f9 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Wed, 29 Jul 2015 23:13:33 +0200
+Subject: [PATCH 08/10] kodi-config.cmake: use CMAKE_FIND_ROOT_PATH to fix
+ cross-compilation
+
+When cross-compiling, the location at build time of the libraries is
+not the same as the one at run-time. The CMAKE_FIND_ROOT_PATH variable
+is here to handle this difference, so use it in kodi-config.cmake.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ project/cmake/KodiConfig.cmake.in | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/project/cmake/KodiConfig.cmake.in b/project/cmake/KodiConfig.cmake.in
+index c02a680..9d6a566 100644
+--- a/project/cmake/KodiConfig.cmake.in
++++ b/project/cmake/KodiConfig.cmake.in
+@@ -7,10 +7,10 @@ if(NOT @APP_NAME_UC@_PREFIX)
+   set(@APP_NAME_UC@_PREFIX @APP_PREFIX@)
+ endif()
+ if(NOT @APP_NAME_UC@_INCLUDE_DIR)
+-  set(@APP_NAME_UC@_INCLUDE_DIR @APP_INCLUDE_DIR@)
++  set(@APP_NAME_UC@_INCLUDE_DIR ${CMAKE_FIND_ROOT_PATH}/@APP_INCLUDE_DIR@)
+ endif()
+ if(NOT @APP_NAME_UC@_LIB_DIR)
+-  set(@APP_NAME_UC@_LIB_DIR @APP_LIB_DIR@)
++  set(@APP_NAME_UC@_LIB_DIR ${CMAKE_FIND_ROOT_PATH}/@APP_LIB_DIR@)
+ endif()
+ if(NOT @APP_NAME_UC@_DATA_DIR)
+   set(@APP_NAME_UC@_DATA_DIR @APP_DATA_DIR@)
+@@ -19,6 +19,7 @@ if(NOT WIN32)
+   set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} @CXX11_SWITCH@")
+ endif()
+ list(APPEND CMAKE_MODULE_PATH @APP_LIB_DIR@ @APP_DATA_DIR@/cmake)
++list(APPEND CMAKE_MODULE_PATH ${CMAKE_FIND_ROOT_PATH}/@APP_LIB_DIR@ ${CMAKE_FIND_ROOT_PATH}/@APP_DATA_DIR@/cmake)
+ 
+ string(REPLACE ";" " " ARCH_DEFINES "@ARCH_DEFINES@")
+ add_definitions(${ARCH_DEFINES} -DBUILD_KODI_ADDON)
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0009-build-Add-support-for-musl-triplets.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0009-build-Add-support-for-musl-triplets.patch
new file mode 100644
index 0000000..f3e739a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0009-build-Add-support-for-musl-triplets.patch
@@ -0,0 +1,180 @@
+From 8b2bad58585af0f829fb06e19c9bd2b6caf30808 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 6 Nov 2016 11:54:41 -0800
+Subject: [PATCH 09/10] build: Add support for musl triplets
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac               | 12 ++++++------
+ m4/xbmc_arch.m4            | 22 +++++++++++-----------
+ tools/depends/configure.ac | 12 ++++++------
+ 3 files changed, 23 insertions(+), 23 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index ab4eea3..925466a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -526,7 +526,7 @@ case $host in
+      use_x11=no
+      build_shared_lib=yes
+      ;;
+-  i*86*-linux-gnu*|i*86*-*-linux-uclibc*)
++  i*86*-linux-gnu*|i*86*-*-linux-uclibc*|i*86*-*-linux-musl*)
+      target_platform=target_linux
+      CORE_SYSTEM_NAME=linux
+      ARCH="i486-linux"
+@@ -549,7 +549,7 @@ case $host in
+        fi
+      fi
+      ;;
+-  x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*)
++  x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*|x86_64-*-linux-musl*)
+      target_platform=target_linux
+      CORE_SYSTEM_NAME=linux
+      ARCH="x86_64-linux"
+@@ -601,17 +601,17 @@ case $host in
+      DEPENDS_ROOT_FOR_XCODE=$(echo ${prefix%/*})
+      AC_SUBST([DEPENDS_ROOT_FOR_XCODE])
+      ;;
+-  powerpc-*-linux-gnu*|powerpc-*-linux-uclibc*)
++  powerpc-*-linux-gnu*|powerpc-*-linux-uclibc*|powerpc-*-linux-musl*)
+      target_platform=target_linux
+      CORE_SYSTEM_NAME=linux
+      ARCH="powerpc-linux"
+      ;;
+-  powerpc64*-*-linux-gnu*|powerpc64*-*-linux-uclibc*)
++  powerpc64*-*-linux-gnu*|powerpc64*-*-linux-uclibc*|powerpc64*-*-linux-musl*)
+      target_platform=target_linux
+      CORE_SYSTEM_NAME=linux
+      ARCH="powerpc64-linux"
+      ;;
+-  arm*-*-linux-gnu*|arm*-*-linux-uclibc*)
++  arm*-*-linux-gnu*|arm*-*-linux-uclibc*|arm*-*-linux-musl*)
+      target_platform=target_linux
+      CORE_SYSTEM_NAME=linux
+      ARCH="arm"
+@@ -621,7 +621,7 @@ case $host in
+      use_gl=no
+      USE_STATIC_FFMPEG=1
+      ;;
+-  aarch64*-*-linux-gnu*|aarch64*-*-linux-uclibc*)
++  aarch64*-*-linux-gnu*|aarch64*-*-linux-uclibc*|aarch64*-*-linux-musl*)
+      target_platform=target_linux
+      ARCH="aarch64"
+      use_arch="aarch64"
+diff --git a/m4/xbmc_arch.m4 b/m4/xbmc_arch.m4
+index d28f263..ff5dc20 100644
+--- a/m4/xbmc_arch.m4
++++ b/m4/xbmc_arch.m4
+@@ -2,10 +2,10 @@ AC_DEFUN([XBMC_SETUP_ARCH_DEFINES],[
+ 
+ # build detection and setup - this is the native arch
+ case $build in
+-  i*86*-linux-gnu*|i*86*-*-linux-uclibc*)
++  i*86*-linux-gnu*|i*86*-*-linux-uclibc*|i*86*-*-linux-musl*)
+      AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+      ;;
+-  x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*)
++  x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*|x86_64-*-linux-musl*)
+      AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+      ;;
+   i386-*-freebsd*)
+@@ -17,13 +17,13 @@ case $build in
+   *86*-apple-darwin*)
+      AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX -D_LINUX")
+      ;;
+-  powerpc-*-linux-gnu*|powerpc-*-linux-uclibc*)
++  powerpc-*-linux-gnu*|powerpc-*-linux-uclibc*|powerpc-*-linux-musl*)
+      AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC")
+      ;;
+-  powerpc64-*-linux-gnu*|powerpc64-*-linux-uclibc*)
++  powerpc64-*-linux-gnu*|powerpc64-*-linux-uclibc*|powerpc64-*-linux-musl*)
+      AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC64")
+      ;;
+-  arm*-*-linux-gnu*|arm*-*-linux-uclibc*)
++  arm*-*-linux-gnu*|arm*-*-linux-uclibc*|arm*-*-linux-musl*)
+      AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+      ;;
+   *)
+@@ -33,10 +33,10 @@ esac
+ 
+ # host detection and setup - this is the target arch
+ case $host in
+-  i*86*-linux-gnu*|i*86*-*-linux-uclibc*)
++  i*86*-linux-gnu*|i*86*-*-linux-uclibc*|i*86*-*-linux-musl*)
+      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+      ;;
+-  x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*)
++  x86_64-*-linux-gnu*|x86_64-*-linux-uclibc*|x86_64-*-linux-musl*)
+      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+      ;;
+   i386-*-freebsd*)
+@@ -54,16 +54,16 @@ case $host in
+   powerpc-apple-darwin*)
+      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX -D_LINUX")
+      ;;
+-  powerpc-*-linux-gnu*|powerpc-*-linux-uclibc*)
++  powerpc-*-linux-gnu*|powerpc-*-linux-uclibc*|powerpc-*-linux-musl*)
+      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC")
+      ;;
+-  powerpc64*-*-linux-gnu*|powerpc64*-*-linux-uclibc*)
++  powerpc64*-*-linux-gnu*|powerpc64*-*-linux-uclibc*|powerpc64*-*-linux-musl*)
+      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -D_POWERPC64")
+      ;;
+-  arm*-*-linux-gnu*|arm*-*-linux-uclibc*|aarch64*-*-linux-gnu*|aarch64*-*-linux-uclibc*)
++  arm*-*-linux-gnu*|arm*-*-linux-uclibc*|arm*-*-linux-musl*|aarch64*-*-linux-gnu*|aarch64*-*-linux-uclibc*|aarch64*-*-linux-musl*)
+      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+      ;;
+-  mips*-*-linux-gnu*|mips*-*-linux-uclibc*)
++  mips*-*-linux-gnu*|mips*-*-linux-uclibc*|mips*-*-linux-musl*)
+      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+      ;;
+   *-*linux-android*)
+diff --git a/tools/depends/configure.ac b/tools/depends/configure.ac
+index f438e5d..409f4d7 100644
+--- a/tools/depends/configure.ac
++++ b/tools/depends/configure.ac
+@@ -120,13 +120,13 @@ platform_cc=gcc
+ platform_cxx=g++
+ 
+ case $build in
+-  arm*-*-linux-gnu*|arm*-*-linux-uclibc*)
++  arm*-*-linux-gnu*|arm*-*-linux-uclibc*|arm*-*-linux-musl*)
+     build_os="linux"
+   ;;
+-  *i686*-linux-gnu*|i*86*-*-linux-uclibc*)
++  *i686*-linux-gnu*|i*86*-*-linux-uclibc*|i*86*-*-linux-musl*)
+     build_os="linux"
+   ;;
+-  x86_64*-linux-gnu*|x86_64-*-linux-uclibc*)
++  x86_64*-linux-gnu*|x86_64-*-linux-uclibc*|x86_64-*-linux-musl*)
+     build_os="linux"
+   ;;
+   *darwin*)
+@@ -186,7 +186,7 @@ case $host in
+     #android builds are always cross
+     cross_compiling="yes"
+   ;;
+-  arm*-*-linux-gnu*|arm*-*-linux-uclibc*)
++  arm*-*-linux-gnu*|arm*-*-linux-uclibc*|arm*-*-linux-musl*)
+     if test "$use_platform" = "auto"; then
+       if test "x$use_cpu" = "xauto"; then
+         use_cpu=$host_cpu
+@@ -210,12 +210,12 @@ case $host in
+       platform_os="linux"
+     fi
+   ;;
+-  *i686*-linux-gnu*|i*86*-*-linux-uclibc*)
++  *i686*-linux-gnu*|i*86*-*-linux-uclibc*|i*86*-*-linux-musl*)
+     use_cpu=$host_cpu
+     use_toolchain="${use_toolchain:-/usr}"
+     platform_os="linux"
+   ;;
+-  x86_64*-linux-gnu*|x86_64-*-linux-uclibc*)
++  x86_64*-linux-gnu*|x86_64-*-linux-uclibc*|x86_64-*-linux-musl*)
+     use_cpu=$host_cpu
+     use_toolchain="${use_toolchain:-/usr}"
+     platform_cflags="-fPIC -DPIC"
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0010-RssReader-Fix-compiler-warning-comparing-pointer-to-.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0010-RssReader-Fix-compiler-warning-comparing-pointer-to-.patch
new file mode 100644
index 0000000..e34a5b7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0010-RssReader-Fix-compiler-warning-comparing-pointer-to-.patch
@@ -0,0 +1,40 @@
+From 55233024648b5673dbf223586968e71cc4c70711 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 16 Nov 2016 18:49:36 -0800
+Subject: [PATCH 10/10] RssReader: Fix compiler warning comparing pointer to
+ zero
+
+Clang finds this warning
+RssReader.cpp:272:19: error: ordered comparison between pointer and zero ('TiXmlElement *' and 'int')
+  while (itemNode > 0)
+         ~~~~~~~~ ^ ~
+RssReader.cpp:276:22: error: ordered comparison between pointer and zero ('TiXmlNode *' and 'int')
+    while (childNode > 0)
+           ~~~~~~~~~ ^ ~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ xbmc/utils/RssReader.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/xbmc/utils/RssReader.cpp b/xbmc/utils/RssReader.cpp
+index 9186f56..2494dc8 100644
+--- a/xbmc/utils/RssReader.cpp
++++ b/xbmc/utils/RssReader.cpp
+@@ -269,11 +269,11 @@ void CRssReader::GetNewsItems(TiXmlElement* channelXmlNode, int iFeed)
+   if (m_tagSet.empty())
+     AddTag("title");
+ 
+-  while (itemNode > 0)
++  while (itemNode != NULL)
+   {
+     TiXmlNode* childNode = itemNode->FirstChild();
+     mTagElements.clear();
+-    while (childNode > 0)
++    while (childNode != NULL)
+     {
+       std::string strName = childNode->ValueStr();
+ 
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0011-Let-configure-pass-on-unknown-architectures-setting-.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0011-Let-configure-pass-on-unknown-architectures-setting-.patch
new file mode 100644
index 0000000..7ee44f1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0011-Let-configure-pass-on-unknown-architectures-setting-.patch
@@ -0,0 +1,54 @@
+From 19a1ffc1450bd3ecfb7419d74c733b2e16bf47f3 Mon Sep 17 00:00:00 2001
+From: Balint Reczey <balint@balintreczey.hu>
+Date: Wed, 26 Aug 2015 08:14:41 +0200
+Subject: [PATCH 11/12] Let configure pass on unknown architectures setting
+ sane defaults
+
+This helps porting Kodi to new architectures while emitting warnings about
+entering uncharted territory.
+---
+ configure.ac    | 3 ++-
+ m4/xbmc_arch.m4 | 6 ++++--
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 925466a..8369615 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -658,7 +658,8 @@ case $host in
+      USE_STATIC_FFMPEG=1
+      ;;
+   *)
+-     AC_MSG_ERROR(unsupported host ($host))
++    ARCH=$host_cpu"-"$host_os
++    AC_MSG_WARN([unsupported host ($host), guessing ARCH as $ARCH.])
+ esac
+ AC_SUBST([ARCH])
+ 
+diff --git a/m4/xbmc_arch.m4 b/m4/xbmc_arch.m4
+index ff5dc20..dfb45fd 100644
+--- a/m4/xbmc_arch.m4
++++ b/m4/xbmc_arch.m4
+@@ -27,7 +27,8 @@ case $build in
+      AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+      ;;
+   *)
+-     AC_MSG_ERROR(unsupported native build platform: $build)
++     AC_MSG_WARN([unsupported native build platform: $build])
++     AC_SUBST(NATIVE_ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+ esac
+ 
+ 
+@@ -70,7 +71,8 @@ case $host in
+      AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID")
+      ;;
+   *)
+-     AC_MSG_ERROR(unsupported build target: $host)
++     AC_MSG_WARN([unsupported native build platform: $build])
++     AC_SUBST(ARCH_DEFINES, "-DTARGET_POSIX -DTARGET_LINUX -D_LINUX")
+ esac
+ 
+ if test "$target_platform" = "target_android" ; then
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0012-Revert-droid-fix-builds-with-AML-disabled.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0012-Revert-droid-fix-builds-with-AML-disabled.patch
new file mode 100644
index 0000000..8d70b3f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0012-Revert-droid-fix-builds-with-AML-disabled.patch
@@ -0,0 +1,87 @@
+From 9e88aa086083b80c05b2bf057b92682186c4e6dc Mon Sep 17 00:00:00 2001
+From: Balint Reczey <balint@balintreczey.hu>
+Date: Thu, 6 Oct 2016 18:12:18 +0200
+Subject: [PATCH 12/12] Revert "[droid] fix builds with AML disabled"
+
+This reverts commit 4733383b8f1c1dd0b95e9e5358425d8a0b7ba8fc.
+---
+ xbmc/utils/SystemInfo.cpp         |  4 ----
+ xbmc/windowing/egl/EGLWrapper.cpp | 16 ++++++----------
+ 2 files changed, 6 insertions(+), 14 deletions(-)
+
+diff --git a/xbmc/utils/SystemInfo.cpp b/xbmc/utils/SystemInfo.cpp
+index fcc6733..52e7fa3 100644
+--- a/xbmc/utils/SystemInfo.cpp
++++ b/xbmc/utils/SystemInfo.cpp
+@@ -57,10 +57,8 @@
+ #include "utils/XMLUtils.h"
+ #if defined(TARGET_ANDROID)
+ #include "platform/android/jni/Build.h"
+-#if defined(HAS_LIBAMCODEC)
+ #include "utils/AMLUtils.h"
+ #endif
+-#endif
+ 
+ /* Platform identification */
+ #if defined(TARGET_DARWIN)
+@@ -873,11 +871,9 @@ bool CSysInfo::IsAeroDisabled()
+ bool CSysInfo::HasHW3DInterlaced()
+ {
+ #if defined(TARGET_ANDROID)
+-#if defined(HAS_LIBAMCODEC)
+   if (aml_hw3d_present())
+     return true;
+ #endif
+-#endif
+   return false;
+ }
+ 
+diff --git a/xbmc/windowing/egl/EGLWrapper.cpp b/xbmc/windowing/egl/EGLWrapper.cpp
+index 30f5757..583d43a 100644
+--- a/xbmc/windowing/egl/EGLWrapper.cpp
++++ b/xbmc/windowing/egl/EGLWrapper.cpp
+@@ -24,19 +24,15 @@
+ #include <assert.h>
+ #if defined(TARGET_ANDROID)
+   #include "EGLNativeTypeAndroid.h"
+-#if defined(HAS_LIBAMCODEC)
+   #include "EGLNativeTypeAmlAndroid.h"
+ #endif
+-#endif
+ #if defined(TARGET_RASPBERRY_PI)
+   #include "EGLNativeTypeRaspberryPI.h"
+ #endif
+ #if defined(HAS_IMXVPU)
+   #include "EGLNativeTypeIMX.h"
+ #endif
+-#if defined(TARGET_LINUX) && defined(HAS_LIBAMCODEC)
+ #include "EGLNativeTypeAmlogic.h"
+-#endif
+ #include "EGLWrapper.h"
+ 
+ #define CheckError() m_result = eglGetError(); if(m_result != EGL_SUCCESS) CLog::Log(LOGERROR, "EGL error in %s: %x",__FUNCTION__, m_result);
+@@ -91,15 +87,15 @@ bool CEGLWrapper::Initialize(const std::string &implementation)
+   // Try to create each backend in sequence and go with the first one
+   // that we know will work
+   if (
+-#if defined(TARGET_ANDROID) && defined(HAS_LIBAMCODEC)
+-      (nativeGuess = CreateEGLNativeType<CEGLNativeTypeAmlAndroid>(implementation))
+-#elif defined(TARGET_ANDROID)
+-      (nativeGuess = CreateEGLNativeType<CEGLNativeTypeAndroid>(implementation))
+-#elif defined(TARGET_RASPBERRY_PI)
++#if defined(TARGET_ANDROID)
++      (nativeGuess = CreateEGLNativeType<CEGLNativeTypeAmlAndroid>(implementation)) ||
++      (nativeGuess = CreateEGLNativeType<CEGLNativeTypeAndroid>(implementation)) ||
++#endif
++#if defined(TARGET_RASPBERRY_PI)
+       (nativeGuess = CreateEGLNativeType<CEGLNativeTypeRaspberryPI>(implementation))
+ #elif defined(HAS_IMXVPU)
+       (nativeGuess = CreateEGLNativeType<CEGLNativeTypeIMX>(implementation))
+-#elif defined(TARGET_LINUX) && defined(HAS_LIBAMCODEC)
++#else
+       (nativeGuess = CreateEGLNativeType<CEGLNativeTypeAmlogic>(implementation))
+ #endif
+       )
+-- 
+2.10.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0013-FTPParse.cpp-use-std-string.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0013-FTPParse.cpp-use-std-string.patch
new file mode 100644
index 0000000..c9c9066
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-17/0013-FTPParse.cpp-use-std-string.patch
@@ -0,0 +1,96 @@
+From 5fa10ff6b1b60abee172296d9c1dec8dfc10615c Mon Sep 17 00:00:00 2001
+From: Stefan Saraev <stefan@saraev.ca>
+Date: Sun, 7 May 2017 17:30:47 +0300
+Subject: [PATCH] FTPParse.cpp: use std::string
+
+Fixes build with newer gcc versions.
+
+Taken from [1]
+
+Upstream-Status: Backport [2]
+
+[1] https://git.busybox.net/buildroot/plain/package/kodi/0003-FTPParse.cpp-use-std-string.patch?id=e2f03a6bde19766a1ac047c5ccfb049b5c4f61ca
+[2] https://github.com/xbmc/xbmc/commit/5fa10ff6b1b60abee172296d9c1dec8dfc10615c
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+ xbmc/filesystem/FTPParse.cpp | 44 ++++++++++++++++++++++----------------------
+ 1 file changed, 22 insertions(+), 22 deletions(-)
+
+diff --git a/xbmc/filesystem/FTPParse.cpp b/xbmc/filesystem/FTPParse.cpp
+index cfcc7c64ed..b0f676ae1a 100644
+--- a/xbmc/filesystem/FTPParse.cpp
++++ b/xbmc/filesystem/FTPParse.cpp
+@@ -34,7 +34,7 @@ CFTPParse::CFTPParse()
+   m_time = 0;
+ }
+ 
+-string CFTPParse::getName()
++std::string CFTPParse::getName()
+ {
+   return m_name;
+ }
+@@ -59,16 +59,16 @@ time_t CFTPParse::getTime()
+   return m_time;
+ }
+ 
+-void CFTPParse::setTime(string str)
++void CFTPParse::setTime(std::string str)
+ {
+   /* Variables used to capture patterns via the regexes */
+-  string month;
+-  string day;
+-  string year;
+-  string hour;
+-  string minute;
+-  string second;
+-  string am_or_pm;
++  std::string month;
++  std::string day;
++  std::string year;
++  std::string hour;
++  std::string minute;
++  std::string second;
++  std::string am_or_pm;
+ 
+   /* time struct used to set the time_t variable */
+   struct tm time_struct = {};
+@@ -338,21 +338,21 @@ int CFTPParse::getDayOfWeek(int month, int date, int year)
+   return day_of_week;
+ }
+ 
+-int CFTPParse::FTPParse(string str)
++int CFTPParse::FTPParse(std::string str)
+ {
+   /* Various variable to capture patterns via the regexes */
+-  string permissions;
+-  string link_count;
+-  string owner;
+-  string group;
+-  string size;
+-  string date;
+-  string name;
+-  string type;
+-  string stuff;
+-  string facts;
+-  string version;
+-  string file_id;
++  std::string permissions;
++  std::string link_count;
++  std::string owner;
++  std::string group;
++  std::string size;
++  std::string date;
++  std::string name;
++  std::string type;
++  std::string stuff;
++  std::string facts;
++  std::string version;
++  std::string file_id;
+ 
+   /* Regex for standard Unix listing formats */
+   pcrecpp::RE unix_re("^([-bcdlps])" // type
+-- 
+2.11.0
+
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-addon-pvr-hts/0001-Update-to-p8-platform.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-addon-pvr-hts/0001-Update-to-p8-platform.patch
new file mode 100644
index 0000000..c4a6ae7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-addon-pvr-hts/0001-Update-to-p8-platform.patch
@@ -0,0 +1,427 @@
+From 06a8224c99282ac1a606edd9e8ea3f591112942d Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Thu, 18 Feb 2016 14:04:31 +0100
+Subject: [PATCH] Update to p8-platform
+
+---
+ CMakeLists.txt                         |  6 +++---
+ pvr.hts/changelog.txt                  |  4 ++--
+ src/AutoRecordings.cpp                 |  2 +-
+ src/HTSPConnection.cpp                 |  8 +++----
+ src/HTSPDemuxer.cpp                    |  2 +-
+ src/HTSPVFS.cpp                        |  6 +++---
+ src/TimeRecordings.cpp                 |  2 +-
+ src/Tvheadend.cpp                      |  4 ++--
+ src/Tvheadend.h                        | 38 +++++++++++++++++-----------------
+ src/client.cpp                         |  4 ++--
+ src/client.h                           |  4 ++--
+ src/tvheadend/Subscription.cpp         |  2 +-
+ src/tvheadend/Subscription.h           |  4 ++--
+ src/tvheadend/utilities/AsyncState.cpp |  4 ++--
+ src/tvheadend/utilities/AsyncState.h   |  6 +++---
+ 15 files changed, 48 insertions(+), 48 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0842682..cb04942 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -6,10 +6,10 @@ enable_language(CXX)
+ 
+ find_package(kodi REQUIRED)
+ find_package(kodiplatform REQUIRED)
+-find_package(platform REQUIRED)
++find_package(p8-platform REQUIRED)
+ 
+ include_directories(${kodiplatform_INCLUDE_DIRS}
+-                    ${platform_INCLUDE_DIRS}
++                    ${p8-platform_INCLUDE_DIRS}
+                     ${KODI_INCLUDE_DIR}
+                     ${PROJECT_SOURCE_DIR}/lib)
+ 
+@@ -95,7 +95,7 @@ list(APPEND HTS_SOURCES
+ 
+ add_subdirectory(lib/libhts)
+ 
+-set(DEPLIBS ${platform_LIBRARIES} hts)
++set(DEPLIBS ${p8-platform_LIBRARIES} hts)
+ if(WIN32)
+   list(APPEND DEPLIBS ws2_32)
+ endif()
+diff --git a/pvr.hts/changelog.txt b/pvr.hts/changelog.txt
+index 9ffa33c..1e7fe30 100644
+--- a/pvr.hts/changelog.txt
++++ b/pvr.hts/changelog.txt
+@@ -49,7 +49,7 @@
+ - fixed: Autorec: Start and stop time handling.
+ - fixed: LocaltimeToUTC conversion (timer settings clock display incorrect).
+ - fixed: Several issues with predictive tuning.
+-- added: build: Automatically fill in platform and library name.
++- added: build: Automatically fill in p8-platform and library name.
+ - fixed: Use epg data only for creation of epg-based timers.
+ - improved: Do not try to reconnect to tvh while suspending or not fully awake again.
+ 
+@@ -97,7 +97,7 @@
+ - added: support for creating repeating timers, aka time schedules
+ - fixed: conditions for addon restart after settings changes
+ - internal: fixed build system regressions introduced with move to cmake
+-- internal: updated to use libplatform
++- internal: updated to use libp8-platform
+ 
+ 2.1.7
+ - added: support for radio channel groups
+diff --git a/src/AutoRecordings.cpp b/src/AutoRecordings.cpp
+index 5fa60a0..d9e5e1d 100644
+--- a/src/AutoRecordings.cpp
++++ b/src/AutoRecordings.cpp
+@@ -26,7 +26,7 @@
+ #include "tvheadend/utilities/Utilities.h"
+ #include "tvheadend/utilities/Logger.h"
+ 
+-using namespace PLATFORM;
++using namespace P8PLATFORM;
+ using namespace tvheadend;
+ using namespace tvheadend::entity;
+ using namespace tvheadend::utilities;
+diff --git a/src/HTSPConnection.cpp b/src/HTSPConnection.cpp
+index aec1296..86f5004 100644
+--- a/src/HTSPConnection.cpp
++++ b/src/HTSPConnection.cpp
+@@ -19,9 +19,9 @@
+  *
+  */
+ 
+-#include "platform/threads/mutex.h"
+-#include "platform/util/StringUtils.h"
+-#include "platform/sockets/tcp.h"
++#include "p8-platform/threads/mutex.h"
++#include "p8-platform/util/StringUtils.h"
++#include "p8-platform/sockets/tcp.h"
+ 
+ extern "C" {
+ #include "libhts/htsmsg_binary.h"
+@@ -33,7 +33,7 @@ extern "C" {
+ 
+ using namespace std;
+ using namespace ADDON;
+-using namespace PLATFORM;
++using namespace P8PLATFORM;
+ using namespace tvheadend;
+ using namespace tvheadend::utilities;
+ 
+diff --git a/src/HTSPDemuxer.cpp b/src/HTSPDemuxer.cpp
+index a6e1f12..7f45345 100644
+--- a/src/HTSPDemuxer.cpp
++++ b/src/HTSPDemuxer.cpp
+@@ -27,7 +27,7 @@
+ 
+ using namespace std;
+ using namespace ADDON;
+-using namespace PLATFORM;
++using namespace P8PLATFORM;
+ using namespace tvheadend;
+ using namespace tvheadend::utilities;
+ 
+diff --git a/src/HTSPVFS.cpp b/src/HTSPVFS.cpp
+index 0463f56..0404bab 100644
+--- a/src/HTSPVFS.cpp
++++ b/src/HTSPVFS.cpp
+@@ -19,8 +19,8 @@
+  *
+  */
+ 
+-#include "platform/threads/mutex.h"
+-#include "platform/util/StringUtils.h"
++#include "p8-platform/threads/mutex.h"
++#include "p8-platform/util/StringUtils.h"
+ #include "tvheadend/utilities/Logger.h"
+ 
+ extern "C" {
+@@ -30,7 +30,7 @@ extern "C" {
+ #include "Tvheadend.h"
+ 
+ using namespace std;
+-using namespace PLATFORM;
++using namespace P8PLATFORM;
+ using namespace tvheadend::utilities;
+ 
+ /*
+diff --git a/src/TimeRecordings.cpp b/src/TimeRecordings.cpp
+index 5d34938..97aae09 100644
+--- a/src/TimeRecordings.cpp
++++ b/src/TimeRecordings.cpp
+@@ -25,7 +25,7 @@
+ #include "tvheadend/utilities/Utilities.h"
+ #include "tvheadend/utilities/Logger.h"
+ 
+-using namespace PLATFORM;
++using namespace P8PLATFORM;
+ using namespace tvheadend;
+ using namespace tvheadend::entity;
+ using namespace tvheadend::utilities;
+diff --git a/src/Tvheadend.cpp b/src/Tvheadend.cpp
+index 2057241..14c3bd4 100644
+--- a/src/Tvheadend.cpp
++++ b/src/Tvheadend.cpp
+@@ -23,7 +23,7 @@
+ #include <ctime>
+ #include <memory>
+ 
+-#include "platform/util/StringUtils.h"
++#include "p8-platform/util/StringUtils.h"
+ 
+ #include "Tvheadend.h"
+ #include "tvheadend/utilities/Utilities.h"
+@@ -31,7 +31,7 @@
+ 
+ using namespace std;
+ using namespace ADDON;
+-using namespace PLATFORM;
++using namespace P8PLATFORM;
+ using namespace tvheadend;
+ using namespace tvheadend::entity;
+ using namespace tvheadend::utilities;
+diff --git a/src/Tvheadend.h b/src/Tvheadend.h
+index 2ce4552..e794716 100644
+--- a/src/Tvheadend.h
++++ b/src/Tvheadend.h
+@@ -22,10 +22,10 @@
+  */
+ 
+ #include "client.h"
+-#include "platform/sockets/tcp.h"
+-#include "platform/threads/threads.h"
+-#include "platform/threads/mutex.h"
+-#include "platform/util/buffer.h"
++#include "p8-platform/sockets/tcp.h"
++#include "p8-platform/threads/threads.h"
++#include "p8-platform/threads/mutex.h"
++#include "p8-platform/util/buffer.h"
+ #include "kodi/xbmc_codec_types.h"
+ #include "kodi/xbmc_stream_utils.hpp"
+ #include "kodi/libXBMC_addon.h"
+@@ -88,7 +88,7 @@ class CHTSPMessage;
+ 
+ /* Typedefs */
+ typedef std::map<uint32_t,CHTSPResponse*> CHTSPResponseList;
+-typedef PLATFORM::SyncedBuffer<CHTSPMessage> CHTSPMessageQueue;
++typedef P8PLATFORM::SyncedBuffer<CHTSPMessage> CHTSPMessageQueue;
+ 
+ /*
+  * HTSP Response handler
+@@ -98,10 +98,10 @@ class CHTSPResponse
+ public:
+   CHTSPResponse();
+   ~CHTSPResponse();
+-  htsmsg_t *Get ( PLATFORM::CMutex &mutex, uint32_t timeout );
++  htsmsg_t *Get ( P8PLATFORM::CMutex &mutex, uint32_t timeout );
+   void      Set ( htsmsg_t *m );
+ private:
+-  PLATFORM::CCondition<volatile bool> m_cond;
++  P8PLATFORM::CCondition<volatile bool> m_cond;
+   bool                                m_flag;
+   htsmsg_t                           *m_msg;
+ };
+@@ -146,7 +146,7 @@ public:
+  * HTSP Connection registration thread
+  */
+ class CHTSPRegister
+-  : public PLATFORM::CThread
++  : public P8PLATFORM::CThread
+ {
+   friend class CHTSPConnection;
+ 
+@@ -163,7 +163,7 @@ private:
+  * HTSP Connection
+  */
+ class CHTSPConnection
+-  : public PLATFORM::CThread
++  : public P8PLATFORM::CThread
+ {
+   friend class CHTSPRegister;
+ 
+@@ -190,7 +190,7 @@ public:
+   inline bool IsConnected       ( void ) const { return m_ready; }
+   bool        WaitForConnection ( void );
+ 
+-  inline PLATFORM::CMutex& Mutex ( void ) { return m_mutex; }
++  inline P8PLATFORM::CMutex& Mutex ( void ) { return m_mutex; }
+ 
+   void        OnSleep ( void );
+   void        OnWake  ( void );
+@@ -202,10 +202,10 @@ private:
+   bool        SendHello        ( void );
+   bool        SendAuth         ( const std::string &u, const std::string &p );
+ 
+-  PLATFORM::CTcpSocket               *m_socket;
+-  PLATFORM::CMutex                    m_mutex;
++  P8PLATFORM::CTcpSocket               *m_socket;
++  P8PLATFORM::CMutex                    m_mutex;
+   CHTSPRegister                       m_regThread;
+-  PLATFORM::CCondition<volatile bool> m_regCond;
++  P8PLATFORM::CCondition<volatile bool> m_regCond;
+   bool                                m_ready;
+   uint32_t                            m_seq;
+   std::string                         m_serverName;
+@@ -273,13 +273,13 @@ public:
+   void SetStreamingProfile(const std::string &profile);
+ 
+ private:
+-  PLATFORM::CMutex                        m_mutex;
++  P8PLATFORM::CMutex                        m_mutex;
+   CHTSPConnection                        &m_conn;
+-  PLATFORM::SyncedBuffer<DemuxPacket*>    m_pktBuffer;
++  P8PLATFORM::SyncedBuffer<DemuxPacket*>    m_pktBuffer;
+   ADDON::XbmcStreamProperties             m_streams;
+   std::map<int,int>                       m_streamStat;
+   int64_t                                 m_seekTime;
+-  PLATFORM::CCondition<volatile int64_t>  m_seekCond;
++  P8PLATFORM::CCondition<volatile int64_t>  m_seekCond;
+   bool                                    m_seeking;
+   bool                                    m_speedChange;
+   tvheadend::status::SourceInfo           m_sourceInfo;
+@@ -350,7 +350,7 @@ private:
+  * Root object for Tvheadend connection
+  */
+ class CTvheadend
+-  : public PLATFORM::CThread
++  : public P8PLATFORM::CThread
+ {
+ public:
+   CTvheadend();
+@@ -422,7 +422,7 @@ private:
+    */
+   tvheadend::Profiles         m_profiles;
+ 
+-  PLATFORM::CMutex            m_mutex;
++  P8PLATFORM::CMutex            m_mutex;
+ 
+   CHTSPConnection             m_conn;
+ 
+@@ -519,7 +519,7 @@ public:
+    */
+   bool WaitForConnection ( void )
+   {
+-    PLATFORM::CLockObject lock(m_conn.Mutex());
++    P8PLATFORM::CLockObject lock(m_conn.Mutex());
+     return m_conn.WaitForConnection();
+   }
+   std::string GetServerName    ( void )
+diff --git a/src/client.cpp b/src/client.cpp
+index 94d2db9..3295914 100644
+--- a/src/client.cpp
++++ b/src/client.cpp
+@@ -22,14 +22,14 @@
+ #include "client.h"
+ #include "kodi/xbmc_pvr_dll.h"
+ #include "kodi/libKODI_guilib.h"
+-#include "platform/util/util.h"
++#include "p8-platform/util/util.h"
+ #include "Tvheadend.h"
+ #include "tvheadend/Settings.h"
+ #include "tvheadend/utilities/Logger.h"
+ 
+ using namespace std;
+ using namespace ADDON;
+-using namespace PLATFORM;
++using namespace P8PLATFORM;
+ using namespace tvheadend;
+ using namespace tvheadend::utilities;
+ 
+diff --git a/src/client.h b/src/client.h
+index 3a5f950..a10659b 100644
+--- a/src/client.h
++++ b/src/client.h
+@@ -20,8 +20,8 @@
+  *
+  */
+ 
+-#include "platform/os.h"
+-#include "platform/threads/mutex.h"
++#include "p8-platform/os.h"
++#include "p8-platform/threads/mutex.h"
+ #include "kodi/libXBMC_addon.h"
+ #include "kodi/libXBMC_pvr.h"
+ #include "kodi/libXBMC_codec.h"
+diff --git a/src/tvheadend/Subscription.cpp b/src/tvheadend/Subscription.cpp
+index 182ca7f..e18af1e 100644
+--- a/src/tvheadend/Subscription.cpp
++++ b/src/tvheadend/Subscription.cpp
+@@ -23,7 +23,7 @@
+ #include "utilities/Logger.h"
+ #include "../Tvheadend.h"
+ 
+-using namespace PLATFORM;
++using namespace P8PLATFORM;
+ using namespace tvheadend;
+ using namespace tvheadend::utilities;
+ 
+diff --git a/src/tvheadend/Subscription.h b/src/tvheadend/Subscription.h
+index b03bcce..363e5ef 100644
+--- a/src/tvheadend/Subscription.h
++++ b/src/tvheadend/Subscription.h
+@@ -22,7 +22,7 @@
+  */
+ 
+ #include <string>
+-#include "platform/threads/mutex.h"
++#include "p8-platform/threads/mutex.h"
+ 
+ extern "C"
+ {
+@@ -146,6 +146,6 @@ namespace tvheadend
+     std::string       m_profile;
+     CHTSPConnection   &m_conn;
+ 
+-    mutable PLATFORM::CMutex  m_mutex;
++    mutable P8PLATFORM::CMutex  m_mutex;
+   };
+ }
+diff --git a/src/tvheadend/utilities/AsyncState.cpp b/src/tvheadend/utilities/AsyncState.cpp
+index 0c30a93..1f4fdf3 100644
+--- a/src/tvheadend/utilities/AsyncState.cpp
++++ b/src/tvheadend/utilities/AsyncState.cpp
+@@ -22,7 +22,7 @@
+ #include "AsyncState.h"
+ 
+ using namespace tvheadend::utilities;
+-using namespace PLATFORM;
++using namespace P8PLATFORM;
+ 
+ struct Param {
+   eAsyncState state;
+@@ -37,7 +37,7 @@ AsyncState::AsyncState(int timeout)
+ 
+ eAsyncState AsyncState::GetState()
+ {
+-  PLATFORM::CLockObject lock(m_mutex);
++  P8PLATFORM::CLockObject lock(m_mutex);
+   return m_state;
+ }
+ 
+diff --git a/src/tvheadend/utilities/AsyncState.h b/src/tvheadend/utilities/AsyncState.h
+index 1d672da..0819cd8 100644
+--- a/src/tvheadend/utilities/AsyncState.h
++++ b/src/tvheadend/utilities/AsyncState.h
+@@ -22,7 +22,7 @@
+ #ifndef ASYNCSTATE_H
+ #define	ASYNCSTATE_H
+ 
+-#include "platform/threads/mutex.h"
++#include "p8-platform/threads/mutex.h"
+ 
+ namespace tvheadend {
+   namespace utilities {
+@@ -75,8 +75,8 @@ namespace tvheadend {
+       static bool PredicateCallback ( void *param );
+ 
+       eAsyncState m_state;
+-      PLATFORM::CMutex m_mutex;
+-      PLATFORM::CCondition<bool> m_condition;
++      P8PLATFORM::CMutex m_mutex;
++      P8PLATFORM::CCondition<bool> m_condition;
+       int m_timeout;
+ 
+     };
+-- 
+2.0.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-addon-pvr-hts_git.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-addon-pvr-hts_git.bb
new file mode 100644
index 0000000..7cafebf
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-addon-pvr-hts_git.bb
@@ -0,0 +1,57 @@
+SUMMARY = "Kodi Media Center PVR plugins"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://src/client.cpp;md5=c8f6b73c5bc1048a3d6506700a7a91d2"
+
+DEPENDS = " \
+            zip-native \
+            p8platform \
+            kodi-platform \
+          "
+
+SRCREV_pvrhts = "7f75b70527922aef953123ff97ebaa22d9fb7cb4"
+
+SRCREV_FORMAT = "pvrhts"
+
+PV = "2.2.13+gitr${SRCPV}"
+SRC_URI = "git://github.com/kodi-pvr/pvr.hts.git;branch=Jarvis;destsuffix=pvr.hts;name=pvrhts \
+           file://0001-Update-to-p8-platform.patch \
+          "
+
+inherit cmake pkgconfig gettext
+
+S = "${WORKDIR}/pvr.hts"
+
+EXTRA_OECMAKE = " \
+	  -DADDONS_TO_BUILD=pvr.hts \
+	  -DADDON_SRC_PREFIX=${WORKDIR}/git \
+	  -DCMAKE_BUILD_TYPE=Debug \
+	  -DCMAKE_INSTALL_PREFIX=${datadir}/kodi/addons \
+          -DCMAKE_MODULE_PATH=${STAGING_DIR_HOST}${libdir}/kodi \
+          -DCMAKE_PREFIX_PATH=${STAGING_DIR_HOST}${prefix} \
+          -DPACKAGE_ZIP=1 \
+        "
+
+do_compile_prepend() {
+	sed -i -e 's:I/usr/include:I${STAGING_INCDIR}:g' \
+	       -e 's:-pipe:${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} -pipe:g' \
+	          ${B}/CMakeFiles/*/flags.make
+	sed -i -e 's:-pipe:${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} -pipe:g'\
+	          ${B}/CMakeFiles/*/link.txt
+}
+
+# Make zip package for manual installation
+do_install_append() {
+	install -d ${D}${datadir}/kodi/addons/packages/
+	( cd ${D}${datadir}/kodi/addons
+	  zip -r ${D}${datadir}/kodi/addons/packages/pvr.hts-${PV}.zip pvr.hts -x '*.debug*' )
+}
+
+# Doesn't get added automagically, dlopen()?
+RDEPENDS_${PN} = "libkodiplatform"
+
+INSANE_SKIP_${PN} = "dev-so"
+FILES_${PN} += "${datadir}/kodi"
+FILES_${PN}-dbg += "${datadir}/kodi/addons/*/.debug/"
+
+PNBLACKLIST[kodi-addon-pvr-hts] ?= "Depends on blacklisted kodi - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-platform/0001-fix-cross-compile-badness.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-platform/0001-fix-cross-compile-badness.patch
new file mode 100644
index 0000000..27e9d21
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-platform/0001-fix-cross-compile-badness.patch
@@ -0,0 +1,40 @@
+From 3136317f096ea7fda4fb907e775a01952c4aae3d Mon Sep 17 00:00:00 2001
+From: Stefan Saraev <stefan@saraev.ca>
+Date: Fri, 19 Feb 2016 10:33:00 +0100
+Subject: [PATCH] fix cross compile badness
+
+From https://github.com/OpenELEC/OpenELEC.tv/blob/master/packages/mediacenter/kodi-platform/patches/kodi-platform-01_crosscompile-badness.patch
+---
+ CMakeLists.txt               | 2 +-
+ kodiplatform-config.cmake.in | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index bf6b659..9abe773 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -22,7 +22,7 @@ if(NOT WIN32)
+   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+ endif()
+ 
+-set(kodiplatform_INCLUDE_DIRS ${TINYXML_INCLUDE_DIR} "${CMAKE_INSTALL_PREFIX}/include/kodi")
++set(kodiplatform_INCLUDE_DIRS ${TINYXML_INCLUDE_DIR} "${CMAKE_INSTALL_PREFIX_TOOLCHAIN}/include/kodi")
+ IF(WIN32)
+   LIST(APPEND kodiplatform_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/include/kodi/windows")
+ ENDIF(WIN32)
+diff --git a/kodiplatform-config.cmake.in b/kodiplatform-config.cmake.in
+index 3fc5273..60bdf1b 100644
+--- a/kodiplatform-config.cmake.in
++++ b/kodiplatform-config.cmake.in
+@@ -10,7 +10,7 @@
+ #
+ # propagate these properties from one build system to the other
+ set (kodiplatform_VERSION "@kodiplatform_VERSION_MAJOR@.@kodiplatform_VERSION_MINOR@")
+-set (kodiplatform_INCLUDE_DIRS @kodiplatform_INCLUDE_DIRS@ @CMAKE_INSTALL_PREFIX@/include)
++set (kodiplatform_INCLUDE_DIRS @kodiplatform_INCLUDE_DIRS@ @CMAKE_INSTALL_PREFIX_TOOLCHAIN@/include)
+ set (kodiplatform_LIBRARY_DIRS "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@")
+ set (kodiplatform_LINKER_FLAGS "@kodiplatform_LINKER_FLAGS@")
+ set (kodiplatform_CONFIG_VARS "@kodiplatform_CONFIG_VARS@")
+-- 
+2.0.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-platform/kodi-platform-02_no-multi-lib.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-platform/kodi-platform-02_no-multi-lib.patch
new file mode 100644
index 0000000..a13c53b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-platform/kodi-platform-02_no-multi-lib.patch
@@ -0,0 +1,12 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 9abe773..ae433fc 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -9,7 +9,6 @@ find_package(kodi REQUIRED)
+ find_package(TinyXML REQUIRED)
+ find_package(Threads REQUIRED)
+ find_package(p8-platform REQUIRED)
+-include(UseMultiArch.cmake)
+ include(CheckAtomic.cmake)
+ 
+ set(kodiplatform_NAME kodiplatform)
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-platform_git.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-platform_git.bb
new file mode 100644
index 0000000..0b554ef
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-platform_git.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Platform support library used by libCEC and binary add-ons for Kodi"
+HOMEPAGE = "http://libcec.pulse-eight.com/"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://src/util/XMLUtils.cpp;beginline=2;endline=18;md5=dae8e846500e70dd8ecee55f3f018c30"
+
+DEPENDS = "libtinyxml kodi"
+
+PV = "16.0.0"
+
+SRCREV = "c8188d82678fec6b784597db69a68e74ff4986b5"
+SRC_URI = "git://github.com/xbmc/kodi-platform.git \
+           file://0001-fix-cross-compile-badness.patch \
+           file://kodi-platform-02_no-multi-lib.patch \
+          "
+
+S = "${WORKDIR}/git"
+
+inherit cmake pkgconfig
+
+EXTRA_OECMAKE = " -DCMAKE_INSTALL_PREFIX_TOOLCHAIN=${STAGING_DIR_TARGET} \
+                  -DCMAKE_INSTALL_LIBDIR=${libdir} \
+                  -DCMAKE_INSTALL_LIBDIR_NOARCH=${libdir} \
+                  -DKODI_INCLUDE_DIR=${STAGING_LIBDIR}/kodi \
+                  -DKODI_INCLUDE_DIR=${STAGING_INCDIR}/kodi \
+                "
+
+do_compile_prepend() {
+	sed -i -e 's:I/usr/include:I${STAGING_INCDIR}:g' \
+	       -e 's:-pipe:${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} -pipe:g' \
+	          ${B}/CMakeFiles/kodiplatform.dir/flags.make
+	sed -i -e 's:-pipe:${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} -pipe:g'\
+	          ${B}/CMakeFiles/kodiplatform.dir/link.txt
+}
+
+RPROVIDES_${PN} += "libkodiplatform"
+FILES_${PN}-dev += "${libdir}/*platform"
+
+PNBLACKLIST[kodi-platform] ?= "Depends on blacklisted kodi - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-startup.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-startup.bb
new file mode 100644
index 0000000..47e8f38
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-startup.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Systemd service for kodi startup"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
+
+PV = "1.0"
+
+SRC_URI = "file://kodi.service"
+
+inherit systemd
+
+do_install() {
+	install -d ${D}/lib/systemd/system
+	install -m 0644 ${WORKDIR}/kodi.service ${D}/lib/systemd/system/ 
+}
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "kodi.service"
+
+RDEPENDS_${PN} += "xinit kodi"
+
+PNBLACKLIST[kodi-startup] ?= "Runtime depends on blacklisted kodi - the recipe will be removed on 2017-09-01 unless the issue is fixed"
+
+PNBLACKLIST[kodi-startup] ?= "Runtime depends on blacklisted kodi-startup-dev - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-startup/kodi.service b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-startup/kodi.service
new file mode 100644
index 0000000..29d0394
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi-startup/kodi.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Kodi media thing
+
+[Service]
+User=root
+Type=simple
+SuccessExitStatus=0 1
+IOSchedulingClass=realtime
+IOSchedulingPriority=0
+
+ExecStart=/usr/bin/xinit /usr/bin/kodi-standalone -- /usr/bin/X :0 
+
+[Install]
+WantedBy=basic.target
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi_17.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi_17.bb
new file mode 100644
index 0000000..43c32fb
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacenter/kodi/kodi_17.bb
@@ -0,0 +1,207 @@
+SUMMARY = "Kodi Media Center"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE.GPL;md5=930e2a5f63425d8dd72dbd7391c43c46"
+
+FILESPATH =. "${FILE_DIRNAME}/kodi-17:"
+
+DEPENDS = " \
+            cmake-native \
+            curl-native \
+            gperf-native \
+            jsonschemabuilder-native \
+            nasm-native \
+            swig-native \
+            unzip-native \
+            yasm-native \
+            zip-native \
+            avahi \
+            boost \
+            bzip2 \
+            curl \
+            dcadec \
+            enca \
+            expat \
+            faad2 \
+            ffmpeg \
+            fontconfig \
+            fribidi \
+            giflib \
+            jasper \
+            libass \
+            libcdio \
+            libcec \
+            libmad \
+            libmicrohttpd \
+            libmms \
+            libmms \
+            libmodplug \
+            libpcre \
+            libplist \
+            libsamplerate0 \
+            libsdl-image \
+            libsdl-mixer \
+            libsquish \
+            libssh \
+            libtinyxml \
+            libusb1 \
+            libxslt \
+            lzo \
+            mpeg2dec \
+            python \
+            samba \
+            sqlite3 \
+            taglib \
+            virtual/egl \
+            virtual/libsdl \
+            wavpack \
+            yajl \
+            zlib \
+            ${@enable_glew(bb, d)} \
+          "
+
+PROVIDES = "xbmc"
+
+SRCREV = "661dd08d221f5b2bf509a696a6aca5ee7d45bb27"
+BASEPV = "17.1"
+PV = "${BASEPV}+gitr${SRCPV}"
+SRC_URI = "git://github.com/xbmc/xbmc.git;branch=Krypton \
+           https://repo.voidlinux.eu/distfiles/${BPN}-${BASEPV}-generated-addons.tar.xz;name=addons;unpack=0 \
+           file://0003-configure-don-t-try-to-run-stuff-to-find-tinyxml.patch \
+           file://0004-handle-SIGTERM.patch \
+           file://0005-add-support-to-read-frequency-output-if-using-intel-.patch \
+           file://0006-Disable-DVD-support.patch \
+           file://0007-Always-compile-libcpluff-as-PIC.patch \
+           file://0008-kodi-config.cmake-use-CMAKE_FIND_ROOT_PATH-to-fix-cr.patch \
+           file://0009-build-Add-support-for-musl-triplets.patch \
+           file://0010-RssReader-Fix-compiler-warning-comparing-pointer-to-.patch \
+           file://0011-Let-configure-pass-on-unknown-architectures-setting-.patch \
+           file://0012-Revert-droid-fix-builds-with-AML-disabled.patch \
+           file://0001-change-order-of-detecting-libegl-and-libgles2.patch \
+           file://0013-FTPParse.cpp-use-std-string.patch \
+"
+
+SRC_URI_append_libc-musl = " \
+           file://0001-Fix-file_Emu-on-musl.patch \
+           file://0002-Remove-FILEWRAP.patch \
+"
+SRC_URI[addons.md5sum] = "719614fa764011a18665d08af5c8c92f"
+SRC_URI[addons.sha256sum] = "350da57408c27473eaf40e7f544bc94841bf101dc4346085260c5c4af0adac97"
+
+inherit autotools-brokensep gettext pythonnative distro_features_check
+
+REQUIRED_DISTRO_FEATURES += "opengl"
+
+S = "${WORKDIR}/git"
+
+# breaks compilation
+ASNEEDED = ""
+
+ACCEL ?= ""
+ACCEL_x86 = "vaapi vdpau"
+ACCEL_x86-64 = "vaapi vdpau"
+
+PACKAGECONFIG ??= "${ACCEL} opengl"
+PACKAGECONFIG_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'x11', ' x11', ' openglesv2', d)}"
+
+PACKAGECONFIG[opengl] = "--enable-gl,--enable-gles,"
+PACKAGECONFIG[openglesv2] = "--enable-gles,--enable-gl,virtual/egl"
+PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva"
+PACKAGECONFIG[vdpau] = "--enable-vdpau,--disable-vdpau,libvdpau"
+PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5"
+PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,libxinerama libxmu libxrandr libxtst"
+PACKAGECONFIG[pulseaudio] = "--enable-pulse,--disable-pulse,pulseaudio"
+PACKAGECONFIG[lcms] = "--enable-lcms2,--disable-lcms2,lcms"
+
+EXTRA_OECONF = " \
+    --disable-debug \
+    --disable-libcap \
+    --disable-ccache \
+    --disable-mid \
+    --enable-libusb \
+    --enable-alsa \
+    --enable-airplay \
+    --disable-optical-drive \
+    --with-ffmpeg=shared \
+    --enable-texturepacker=no \
+    ac_cv_path_JAVA_EXE=/bin/true \
+"
+
+FULL_OPTIMIZATION_armv7a = "-fexpensive-optimizations -fomit-frame-pointer -O3 -ffast-math"
+FULL_OPTIMIZATION_armv7ve = "-fexpensive-optimizations -fomit-frame-pointer -O3 -ffast-math"
+BUILD_OPTIMIZATION = "${FULL_OPTIMIZATION}"
+
+EXTRA_OECONF_append = " LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool"
+
+# for python modules
+export HOST_SYS
+export BUILD_SYS
+export STAGING_LIBDIR
+export STAGING_INCDIR
+export PYTHON_DIR
+
+def enable_glew(bb, d):
+    if bb.utils.contains('PACKAGECONFIG', 'x11', True, False, d) and bb.utils.contains('DISTRO_FEATURES', 'opengl', True, False, d):
+        return "glew"
+    return ""
+
+do_configure() {
+    tar xf ${WORKDIR}/${BPN}-${BASEPV}-generated-addons.tar.xz -C ${S}/
+
+    ( for i in $(find ${S} -name "configure.*" ) ; do
+       cd $(dirname $i) && gnu-configize --force || true
+    done )
+    ( for f in ${S}/xbmc/interfaces/python/generated/*.cpp; do
+       touch `echo $f|sed -e 's/.cpp$/.xml/g'`
+    done )
+    make -C tools/depends/target/crossguid PREFIX=${STAGING_DIR_HOST}${prefix}
+
+    BOOTSTRAP_STANDALONE=1 make -f bootstrap.mk JSON_BUILDER="${STAGING_BINDIR_NATIVE}/JsonSchemaBuilder"
+    BOOTSTRAP_STANDALONE=1 make JAVA=/bin/true -f codegenerator.mk JSON_BUILDER="${STAGING_BINDIR_NATIVE}/JsonSchemaBuilder"
+    oe_runconf
+}
+
+do_compile_prepend() {
+    for i in $(find . -name "Makefile") ; do
+        sed -i -e 's:I/usr/include:I${STAGING_INCDIR}:g' $i
+    done
+
+    for i in $(find . -name "*.mak*" -o    -name "Makefile") ; do
+        sed -i -e 's:I/usr/include:I${STAGING_INCDIR}:g' -e 's:-rpath \$(libdir):-rpath ${libdir}:g' $i
+    done
+}
+
+INSANE_SKIP_${PN} = "rpaths"
+
+FILES_${PN} += "${datadir}/xsessions ${datadir}/icons ${libdir}/xbmc ${datadir}/xbmc"
+FILES_${PN}-dbg += "${libdir}/kodi/.debug ${libdir}/kodi/*/.debug ${libdir}/kodi/*/*/.debug ${libdir}/kodi/*/*/*/.debug"
+
+# kodi uses some kind of dlopen() method for libcec so we need to add it manually
+# OpenGL builds need glxinfo, that's in mesa-demos
+RRECOMMENDS_${PN}_append = " libcec \
+                             python \
+                             python-ctypes \
+                             python-lang \
+                             python-re \
+                             python-netclient \
+                             python-html \
+                             python-difflib \
+                             python-json \
+                             python-zlib \
+                             python-shell \
+                             python-sqlite3 \
+                             python-compression \
+                             libcurl \
+                             ${@bb.utils.contains('PACKAGECONFIG', 'x11', 'xrandr xdpyinfo', '', d)} \
+"
+RRECOMMENDS_${PN}_append_libc-glibc = " glibc-charmap-ibm850 \
+                                        glibc-gconv-ibm850 \
+					glibc-gconv-unicode \
+                                        glibc-gconv-utf-32 \
+					glibc-charmap-utf-8 \
+					glibc-localedata-en-us \
+                                      "
+
+RPROVIDES_${PN} += "xbmc"
+
+TOOLCHAIN = "gcc"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0001-configure-don-t-run-python-distutils-to-find-STAGING.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0001-configure-don-t-run-python-distutils-to-find-STAGING.patch
deleted file mode 100644
index dfc3959..0000000
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0001-configure-don-t-run-python-distutils-to-find-STAGING.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 0dce5a2abd9f42876616c35772a4d71c5399543c Mon Sep 17 00:00:00 2001
-From: Koen Kooi <koen@dominion.thruhere.net>
-Date: Sat, 17 Dec 2011 11:38:15 +0100
-Subject: [PATCH 1/4] configure: don't run python distutils to find STAGING_INCDIR/python, it is not safe for per-machine sysroots
-
-Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
----
- m4/ax_python_devel.m4 |    7 +------
- 1 files changed, 1 insertions(+), 6 deletions(-)
-
-diff --git a/m4/ax_python_devel.m4 b/m4/ax_python_devel.m4
-index adbd207..dee70f6 100644
---- a/m4/ax_python_devel.m4
-+++ b/m4/ax_python_devel.m4
-@@ -151,12 +151,7 @@ $ac_distutils_result])
- 	#
- 	AC_MSG_CHECKING([for Python include path])
- 	if test -z "$PYTHON_CPPFLAGS"; then
--		python_path=`$PYTHON -c "import distutils.sysconfig; \
--			print (distutils.sysconfig.get_python_inc ());"`
--		if test -n "${python_path}"; then
--			python_path="-I$python_path"
--		fi
--		PYTHON_CPPFLAGS=$python_path
-+		PYTHON_CPPFLAGS="-I${STAGING_INCDIR}/${PYTHON_DIR}"
- 	fi
- 	AC_MSG_RESULT([$PYTHON_CPPFLAGS])
- 	AC_SUBST([PYTHON_CPPFLAGS])
--- 
-1.7.2.5
-
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0002-Revert-fixed-ios-Add-memory-barriers-to-atomic-Add-S.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0002-Revert-fixed-ios-Add-memory-barriers-to-atomic-Add-S.patch
deleted file mode 100644
index e0a4037..0000000
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0002-Revert-fixed-ios-Add-memory-barriers-to-atomic-Add-S.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From 7b2a8a7869d257cba35f53f6d877877c29cdac27 Mon Sep 17 00:00:00 2001
-From: Paul Menzel <paulepanter@users.sourceforge.net>
-Date: Sun, 14 Aug 2011 21:53:47 +0200
-Subject: [PATCH 2/4] Revert "fixed:[ios] Add memory barriers to atomic Add/Subtract and Increment/Decrement functions to ensure synchronized accesses."
-
-This reverts commit 9a10c48710df79118e39e9b3bb0a15bf1fe694d1.
-
-The build (OpenEmbedded `angstrom-2010.x` for `MACHINE = "beagleboard") fails with the following error.
-
-        make -C xbmc/threads
-        make[1]: Entering directory `/oe/build-angstrom-next/angstrom-dev/work/armv7a-angstrom-linux-gnueabi/xbmc-10.05-r11+gitr0+9a10c48710df79118e39e9b3bb0a15bf1fe694d1/git/xbmc/threads'
-        CPP     Atomics.o
-        /tmp/ccIzTm3L.s: Assembler messages:
-        /tmp/ccIzTm3L.s:40: Error: garbage following instruction -- `dmb ish'
-        /tmp/ccIzTm3L.s:48: Error: garbage following instruction -- `dmb ish'
-        /tmp/ccIzTm3L.s:76: Error: garbage following instruction -- `dmb ish'
-        /tmp/ccIzTm3L.s:83: Error: garbage following instruction -- `dmb ish'
-        /tmp/ccIzTm3L.s:111: Error: garbage following instruction -- `dmb ish'
-        /tmp/ccIzTm3L.s:118: Error: garbage following instruction -- `dmb ish'
-        /tmp/ccIzTm3L.s:145: Error: garbage following instruction -- `dmb ish'
-        /tmp/ccIzTm3L.s:152: Error: garbage following instruction -- `dmb ish'
-        /tmp/ccIzTm3L.s:180: Error: garbage following instruction -- `dmb ish'
-        /tmp/ccIzTm3L.s:187: Error: garbage following instruction -- `dmb ish'
-        make[1]: *** [Atomics.o] Error 1
-        make[1]: Leaving directory `/oe/build-angstrom-next/angstrom-dev/work/armv7a-angstrom-linux-gnueabi/xbmc-10.05-r11+gitr0+9a10c48710df79118e39e9b3bb0a15bf1fe694d1/git/xbmc/threads'
-        make: *** [xbmc/threads/threads.a] Error 2
----
- xbmc/threads/Atomics.cpp |    8 --------
- 1 files changed, 0 insertions(+), 8 deletions(-)
-
-diff --git a/xbmc/threads/Atomics.cpp b/xbmc/threads/Atomics.cpp
-index 5b09f18..0a98a7e 100644
---- a/xbmc/threads/Atomics.cpp
-+++ b/xbmc/threads/Atomics.cpp
-@@ -194,14 +194,12 @@ long AtomicIncrement(volatile long* pAddr)
- {
-   register long val;
-   asm volatile (
--                "dmb      ish            \n" // Memory barrier. Make sure all memory accesses appearing before this complete before any that appear after
-                 "1:                     \n" 
-                 "ldrex   %0, [%1]       \n" // (val = *pAddr)
-                 "add     %0,  #1        \n" // (val += 1)
-                 "strex   r1,  %0, [%1]	\n"
-                 "cmp     r1,   #0       \n"
-                 "bne     1b             \n"
--                "dmb     ish            \n" // Memory barrier.
-                 : "=&r" (val)
-                 : "r"(pAddr)
-                 : "r1"
-@@ -273,14 +271,12 @@ long AtomicAdd(volatile long* pAddr, long amount)
- {
-   register long val;
-   asm volatile (
--                "dmb      ish            \n" // Memory barrier. Make sure all memory accesses appearing before this complete before any that appear after
-                 "1:                     \n" 
-                 "ldrex   %0, [%1]       \n" // (val = *pAddr)
-                 "add     %0,  %2        \n" // (val += amount)
-                 "strex   r1,  %0, [%1]	\n"
-                 "cmp     r1,   #0       \n"
-                 "bne     1b             \n"
--                "dmb     ish            \n" // Memory barrier.
-                 : "=&r" (val)
-                 : "r"(pAddr), "r"(amount)
-                 : "r1"
-@@ -351,14 +347,12 @@ long AtomicDecrement(volatile long* pAddr)
- {
-   register long val;
-   asm volatile (
--                "dmb      ish            \n" // Memory barrier. Make sure all memory accesses appearing before this complete before any that appear after
-                 "1:                     \n" 
-                 "ldrex   %0, [%1]       \n" // (val = *pAddr)
-                 "sub     %0,  #1        \n" // (val -= 1)
-                 "strex   r1,  %0, [%1]	\n"
-                 "cmp     r1,   #0       \n"
-                 "bne     1b             \n"
--                "dmb     ish            \n" // Memory barrier.
-                 : "=&r" (val)
-                 : "r"(pAddr)
-                 : "r1"
-@@ -431,14 +425,12 @@ long AtomicSubtract(volatile long* pAddr, long amount)
- {
-   register long val;
-   asm volatile (
--                "dmb     ish            \n" // Memory barrier. Make sure all memory accesses appearing before this complete before any that appear after
-                 "1:                     \n" 
-                 "ldrex   %0, [%1]       \n" // (val = *pAddr)
-                 "sub     %0,  %2        \n" // (val -= amount)
-                 "strex   r1,  %0, [%1]	\n"
-                 "cmp     r1,   #0       \n"
-                 "bne     1b             \n"
--                "dmb     ish            \n" // Memory barrier.
-                 : "=&r" (val)
-                 : "r"(pAddr), "r"(amount)
-                 : "r1"
--- 
-1.7.2.5
-
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0003-Revert-fixed-ios-Add-memory-barriers-to-cas-assembly.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0003-Revert-fixed-ios-Add-memory-barriers-to-cas-assembly.patch
deleted file mode 100644
index 629017b..0000000
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0003-Revert-fixed-ios-Add-memory-barriers-to-cas-assembly.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From aaae1616a09d359b52e929f944ca0ceb4bb7f831 Mon Sep 17 00:00:00 2001
-From: Paul Menzel <paulepanter@users.sourceforge.net>
-Date: Sun, 14 Aug 2011 21:55:09 +0200
-Subject: [PATCH 3/4] Revert "fixed:[ios] Add memory barriers to cas() assembly to ensure alignment of memory accesses."
-
-This reverts commit 92bab651e2253d172879995b50985645b77fecd2.
-
-The build (OpenEmbedded `angstrom-2010.x` for `MACHINE = "beagleboard") fails with the following error.
-
-        CPP     Atomics.o
-        make[1]: Entering directory `/oe/build-angstrom-next/angstrom-dev/work/armv7a-angstrom-linux-gnueabi/xbmc-10.05-r11+gitr0+92bab651e2253d172879995b50985645b77fecd2/git/xbmc/windows'
-        CPP     GUIMediaWindow.o
-        /tmp/ccrsywuV.s: Assembler messages:
-        /tmp/ccrsywuV.s:40: Error: garbage following instruction -- `dmb ish'
-        /tmp/ccrsywuV.s:48: Error: garbage following instruction -- `dmb ish'
-        make[1]: *** [Atomics.o] Error 1
-        make[1]: Leaving directory `/oe/build-angstrom-next/angstrom-dev/work/armv7a-angstrom-linux-gnueabi/xbmc-10.05-r11+gitr0+92bab651e2253d172879995b50985645b77fecd2/git/xbmc/threads'
-        make: *** [xbmc/threads/threads.a] Error 2
----
- xbmc/threads/Atomics.cpp |   33 ++++++++++++++++-----------------
- 1 files changed, 16 insertions(+), 17 deletions(-)
-
-diff --git a/xbmc/threads/Atomics.cpp b/xbmc/threads/Atomics.cpp
-index 0a98a7e..0967eb2 100644
---- a/xbmc/threads/Atomics.cpp
-+++ b/xbmc/threads/Atomics.cpp
-@@ -49,23 +49,22 @@ long cas(volatile long *pAddr, long expectedVal, long swapVal)
- #elif defined(__arm__)
- long cas(volatile long* pAddr, long expectedVal, long swapVal)
- {
--  register long prev;
--  asm volatile (
--                "dmb      ish            \n" // Memory barrier. Make sure all memory accesses appearing before this complete before any that appear after
--                "1:                      \n"
--                "ldrex    %0, [%1]       \n" // Load the current value of *pAddr(%1) into prev (%0) and lock pAddr,
--                "cmp      %0,  %2        \n" // Verify that the current value (%0) == old value (%2)
--                "bne      2f             \n" // Bail if the two values are not equal [not as expected]
--                "strex    r1,  %3, [%1]  \n"
--                "cmp      r1,  #0        \n"
--                "bne      1b             \n"
--                "dmb      ish            \n" // Memory barrier.
--                "2:                      \n"
--                : "=&r" (prev)
--                : "r"(pAddr), "r"(expectedVal),"r"(swapVal)
--                : "r1"
--                );
--  return prev;
-+  return(__sync_val_compare_and_swap(pAddr, expectedVal, swapVal));
-+//  register long prev;
-+//  asm volatile (
-+//                "1:                      \n"
-+//                "ldrex    %0, [%1]       \n" /* Load the current value of *pAddr(%1) into prev (%0) and lock pAddr,  */
-+//                "cmp      %0,  %2        \n" /* Verify that the current value (%0) == old value (%2) */
-+//                "bne      2f             \n" /* Bail if the two values are not equal [not as expected] */
-+//                "strex    r1,  %3, [%1]  \n"
-+//                "cmp      r1,  #0        \n"                
-+//                "bne      1b             \n"
-+//                "2:                        "
-+//                : "=&r" (prev)
-+//                : "r"(pAddr), "r"(expectedVal),"r"(swapVal)
-+//                : "r1"
-+//                );
-+//  return prev;
- }
- 
- #elif defined(__mips__)
--- 
-1.7.2.5
-
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0004-configure-cope-with-ld-is-gold-DISTRO_FEATURE.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0004-configure-cope-with-ld-is-gold-DISTRO_FEATURE.patch
deleted file mode 100644
index 345e20e..0000000
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/0004-configure-cope-with-ld-is-gold-DISTRO_FEATURE.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From fd8f73826240aae543a41a2bfeea0056e2fe594d Mon Sep 17 00:00:00 2001
-From: Koen Kooi <koen@dominion.thruhere.net>
-Date: Mon, 11 Mar 2013 11:04:29 +0100
-Subject: [PATCH] configure: cope with ld-is-gold DISTRO_FEATURE
-
-Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
----
-
-Upstream-Stature: backport
-
- configure.in |   12 +++++++-----
- 1 files changed, 7 insertions(+), 5 deletions(-)
-
-diff --git a/configure.in b/configure.in
-index ef94683..c8b459b 100755
---- a/configure.in
-+++ b/configure.in
-@@ -18,9 +18,14 @@ tolower(){
- # check for library basenames
- AC_DEFUN([XB_FIND_SONAME],
- [
-+  #set -x
-   if [[ "$host_vendor" != "apple" ]]; then
-     AC_MSG_CHECKING([for lib$2 soname])
-     $1_FILENAME=$($CC -nostdlib -o /dev/null $LDFLAGS -l$2 -Wl,-M 2>/dev/null | grep "^LOAD.*$2" | awk '{V=2; print $V}')
-+    if [[ -z $$1_FILENAME ]]; then
-+      #try gold linker syntax
-+      $1_FILENAME=$($CC -nostdlib -o /dev/null $LDFLAGS -l$2 -Wl,-t 3>&1 1>&2 2>&3 | grep "$2")
-+    fi
-     if [[ ! -z $$1_FILENAME ]]; then
-       $1_SONAME=$(objdump -p $$1_FILENAME | grep "SONAME.*$2" | awk '{V=2; print $V}')
-     fi
-@@ -55,6 +60,7 @@ AC_DEFUN([XB_FIND_SONAME],
-     AC_MSG_RESULT([$$1_SONAME])
-     AC_SUBST($1_SONAME)
-   fi
-+  #set +x
- ])
- 
- # Function to push and pop libs and includes for a command
--- 
-1.7.7.6
-
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/configure.in-Avoid-running-code.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/configure.in-Avoid-running-code.patch
deleted file mode 100644
index 5c14059..0000000
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc/configure.in-Avoid-running-code.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From cfd851660a594801a591e80dc820c65cb7bd7836 Mon Sep 17 00:00:00 2001
-From: Otavio Salvador <otavio@ossystems.com.br>
-Date: Sat, 6 Oct 2012 06:40:03 -0300
-Subject: [PATCH] configure.in: Avoid running code or we break cross-compile
-
-Upstream-Status: Backport [similar change done for 12.0]
-
-Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
----
- configure.in |    6 +-----
- 1 files changed, 1 insertions(+), 5 deletions(-)
-
-diff --git a/configure.in b/configure.in
-index ef94683..d7efcb0 100755
---- a/configure.in
-+++ b/configure.in
-@@ -1246,11 +1246,7 @@ if test "$use_external_ffmpeg" = "yes"; then
-   AC_DEFINE([USE_EXTERNAL_FFMPEG], [1], [Whether to use external FFmpeg libraries.])
- 
-   # Disable vdpau support if external libavcodec doesn't have it
--  AC_RUN_IFELSE(
--    AC_LANG_PROGRAM([[#include <libavcodec/avcodec.h>]],
--      [[avcodec_register_all();
--        AVCodec *codec = avcodec_find_decoder_by_name("vc1_vdpau");
--        return (codec) ? 0 : 1;]]),,
-+  AC_CHECK_LIB([avcodec], [ff_vdpau_vc1_decode_picture],,
-     [if test "x$use_vdpau" = "xyes"; then
-       AC_MSG_ERROR($ffmpeg_vdpau_not_supported)
-     else
--- 
-1.7.2.5
-
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc_git.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc_git.bb
deleted file mode 100644
index 0d8dd5c..0000000
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-mediacentre/xbmc/xbmc_git.bb
+++ /dev/null
@@ -1,97 +0,0 @@
-SUMMARY = "XBMC Media Center"
-
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://LICENSE.GPL;md5=6eb631b6da7fdb01508a80213ffc35ff"
-
-DEPENDS = "libusb1 libcec libplist expat yajl gperf-native libxmu fribidi mpeg2dec ffmpeg samba fontconfig curl python libass libmodplug libmicrohttpd wavpack libmms cmake-native libsdl-image libsdl-mixer virtual/egl mysql5 sqlite3 libmms faad2 libcdio libpcre boost lzo enca avahi libsamplerate0 libxinerama libxrandr libxtst bzip2 virtual/libsdl jasper zip-native zlib libtinyxml libmad"
-#require recipes/egl/egl.inc
-
-
-SRCREV = "82388d55dae79cbb2e486e307e23202e76a43efa"
-
-# multiple issues
-PNBLACKLIST[xbmc] ?= "/usr/include/c++/ctime:70:11: error: '::gmtime' has not been declared"
-
-PV = "11.0+gitr${SRCPV}"
-PR = "r14"
-SRC_URI = "git://github.com/xbmc/xbmc.git;branch=Eden \
-           file://0001-configure-don-t-run-python-distutils-to-find-STAGING.patch \
-           file://0002-Revert-fixed-ios-Add-memory-barriers-to-atomic-Add-S.patch \
-           file://0003-Revert-fixed-ios-Add-memory-barriers-to-cas-assembly.patch \
-           file://0004-configure-cope-with-ld-is-gold-DISTRO_FEATURE.patch \
-           file://configure.in-Avoid-running-code.patch \
-"
-
-inherit autotools gettext python-dir
-
-S = "${WORKDIR}/git"
-
-# breaks compilation
-CCACHE = ""
-
-CACHED_CONFIGUREVARS += " \
-    ac_cv_path_PYTHON="${STAGING_BINDIR_NATIVE}/python-native/python" \
-"
-
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl', 'openglesv2', d)}"
-PACKAGECONFIG[opengl] = "--enable-gl,--enable-gles,glew"
-PACKAGECONFIG[openglesv2] = "--enable-gles,--enable-gl,"
-
-EXTRA_OECONF = " \
-    --disable-rpath \
-    --enable-libusb \
-    --enable-airplay \
-    --disable-optical-drive \
-    --enable-external-libraries \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', '--enable-gl', '--enable-gles', d)} \
-"
-
-FULL_OPTIMIZATION_armv7a = "-fexpensive-optimizations -fomit-frame-pointer -O4 -ffast-math"
-BUILD_OPTIMIZATION = "${FULL_OPTIMIZATION}"
-
-EXTRA_OECONF_append_armv7a = "--cpu=cortex-a8"
-
-# for python modules
-export STAGING_LIBDIR
-export STAGING_INCDIR
-export PYTHON_DIR
-
-do_configure() {
-    sh bootstrap
-    oe_runconf
-}
-
-PARALLEL_MAKE = ""
-
-do_compile_prepend() {
-    for i in $(find . -name "Makefile") ; do
-        sed -i -e 's:I/usr/include:I${STAGING_INCDIR}:g' $i
-    done
-
-    for i in $(find . -name "*.mak*" -o    -name "Makefile") ; do
-        sed -i -e 's:I/usr/include:I${STAGING_INCDIR}:g' -e 's:-rpath \$(libdir):-rpath ${libdir}:g' $i
-    done
-}
-
-INSANE_SKIP_${PN} = "rpaths"
-
-# on ARM architectures xbmc will use GLES which will make the regular wrapper fail, so start it directly
-do_install_append_arm() {
-    sed -i -e 's:Exec=xbmc:Exec=${libdir}/xbmc/xbmc.bin:g' ${D}${datadir}/applications/xbmc.desktop
-}
-
-FILES_${PN} += "${datadir}/xsessions ${datadir}/icons"
-FILES_${PN}-dbg += "${libdir}/xbmc/.debug ${libdir}/xbmc/*/.debug ${libdir}/xbmc/*/*/.debug ${libdir}/xbmc/*/*/*/.debug"
-
-# xbmc uses some kind of dlopen() method for libcec so we need to add it manually
-# OpenGL builds need glxinfo, that's in mesa-demos
-RRECOMMENDS_${PN}_append = " libcec \
-                             python \
-                             python-lang \
-                             python-re \
-                             python-netclient \
-                             libcurl \
-                             xdpyinfo \
-                             ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-demos', '', d)} \
-"
-RRECOMMENDS_${PN}_append_libc-glibc = " glibc-charmap-ibm850 glibc-gconv-ibm850"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-mkv/mkvtoolnix/mkvtoolnix_git.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-mkv/mkvtoolnix/mkvtoolnix_git.bb
index fe44ccf..8a14264 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-mkv/mkvtoolnix/mkvtoolnix_git.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-mkv/mkvtoolnix/mkvtoolnix_git.bb
@@ -54,4 +54,4 @@
 # | src/common/../../lib/boost/utf8_codecvt_facet/utf8_codecvt_facet.cpp:174:5: error: 'int mtx::utf8_codecvt_facet::do_length' is not a static data member of 'struct mtx::utf8_codecvt_facet'
 # |      BOOST_CODECVT_DO_LENGTH_CONST std::mbstate_t &,
 # |      ^
-PNBLACKLIST[mkvtoolnix] ?= "BROKEN: Failx to build with gcc-5"
+PNBLACKLIST[mkvtoolnix] ?= "BROKEN: Failx to build with gcc-5 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/caps/caps/0001-basic.h-Use-c99-supported-stdint-types.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/caps/caps/0001-basic.h-Use-c99-supported-stdint-types.patch
new file mode 100644
index 0000000..1087b0e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/caps/caps/0001-basic.h-Use-c99-supported-stdint-types.patch
@@ -0,0 +1,46 @@
+From a5cea22294a9acb6eed955bd415f562a6cc36482 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 22 Mar 2017 11:54:23 -0700
+Subject: [PATCH] basic.h: Use c99 supported stdint types
+
+include stdint.h for getting the definitions for int types
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ basics.h | 17 +++++++++--------
+ 1 file changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/basics.h b/basics.h
+index 643d96e..1dc2fa7 100644
+--- a/basics.h
++++ b/basics.h
+@@ -46,17 +46,18 @@
+ 
+ #include <assert.h>
+ #include <stdio.h>
++#include <stdint.h>
+ 
+ #include "ladspa.h"
+ 
+-typedef __int8_t			int8;
+-typedef __uint8_t			uint8;
+-typedef __int16_t			int16;
+-typedef __uint16_t		uint16;
+-typedef __int32_t			int32;
+-typedef __uint32_t		uint32;
+-typedef __int64_t			int64;
+-typedef __uint64_t		uint64;
++typedef int8_t			int8;
++typedef uint8_t			uint8;
++typedef int16_t			int16;
++typedef uint16_t		uint16;
++typedef int32_t			int32;
++typedef uint32_t		uint32;
++typedef int64_t			int64;
++typedef uint64_t		uint64;
+ 
+ #define MIN_GAIN 1e-6 /* -120 dB */
+ /* smallest non-denormal 32 bit IEEE float is 1.18e-38 */
+-- 
+2.12.0
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/caps/caps/append_ldflags.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/caps/caps/append_ldflags.patch
new file mode 100644
index 0000000..3abd381
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/caps/caps/append_ldflags.patch
@@ -0,0 +1,18 @@
+Change the order of linker flags such that -shared is appearig after -pie/-fpie
+this helps in building the package when secuiry flags are enabled
+
+-Khem
+
+Index: caps-0.9.24/Makefile
+===================================================================
+--- caps-0.9.24.orig/Makefile
++++ caps-0.9.24/Makefile
+@@ -14,7 +14,7 @@ STRIP = strip
+ -include defines.make
+ 
+ CFLAGS += $(OPTS) $(_CFLAGS)
+-LDFLAGS += $(_LDFLAGS) $(CFLAGS)
++LDFLAGS += $(CFLAGS) $(_LDFLAGS)
+ 
+ PLUG = caps
+ 
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/caps/caps_0.9.24.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/caps/caps_0.9.24.bb
index 3e409e6..d788763 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/caps/caps_0.9.24.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/caps/caps_0.9.24.bb
@@ -3,10 +3,11 @@
 LICENSE = "GPL-3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 
-SRC_URI = " \
-    http://quitte.de/dsp/${PN}_${PV}.tar.bz2 \
-    file://Avoid-ambiguity-in-div-invocation.patch \
-"
+SRC_URI = "http://quitte.de/dsp/${PN}_${PV}.tar.bz2 \
+           file://Avoid-ambiguity-in-div-invocation.patch \
+           file://0001-basic.h-Use-c99-supported-stdint-types.patch \
+           file://append_ldflags.patch \
+           "
 
 SRC_URI[md5sum] = "c1d634038dcb54702306c0e30cb1c626"
 SRC_URI[sha256sum] = "f746feba57af316b159f0169de5d78b4fd1064c2c0c8017cb5856b2f22e83f20"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/cdparanoia_10.2.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/cdparanoia_10.2.bb
index ba368a2..27fa0e5 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/cdparanoia_10.2.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/cdparanoia_10.2.bb
@@ -11,7 +11,12 @@
            file://0001-Use-DESTDIR-in-install-Makefile-rule.patch \
            file://0002-interface-remove-C-reserved-keyword.patch \
            file://0003-Fix-missing-shared-object-LDFLAGS.patch \
-"
+           file://dont-use-internal-configs.patch \
+           file://out-of-tree-build.patch \
+           file://0001-check-for-null-buffer-before-trying-a-byteswap.patch \
+           file://0002-Fix-printf-format-errors.patch \
+           file://0001-utils-Use-c99-compiler-independent-types.patch \
+           "
 SRC_URI[md5sum] = "b304bbe8ab63373924a744eac9ebc652"
 SRC_URI[sha256sum] = "005db45ef4ee017f5c32ec124f913a0546e77014266c6a1c50df902a55fe64df"
 
@@ -24,4 +29,6 @@
 # between the compilation of those two targets)
 PARALLEL_MAKE = ""
 
-inherit autotools-brokensep
+EXTRA_OECONF = "CC='${CC}' CFLAGS='${CFLAGS}'"
+
+inherit autotools
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/0001-check-for-null-buffer-before-trying-a-byteswap.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/0001-check-for-null-buffer-before-trying-a-byteswap.patch
new file mode 100644
index 0000000..682cf6e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/0001-check-for-null-buffer-before-trying-a-byteswap.patch
@@ -0,0 +1,31 @@
+From c760c5d31f2412a5be5ac6896e6069d1cea08527 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 26 Jun 2017 22:31:45 -0700
+Subject: [PATCH 1/2] check for null buffer before trying a byteswap
+
+Author: Monty <paranoia@xiph.org>
+
+Patch from debian
+http://sources.debian.net/src/cdparanoia/3.10.2%2Bdebian-11/debian/patches/04-endian.patch
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ interface/interface.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/interface/interface.c b/interface/interface.c
+index 526c2a9..763a0ea 100644
+--- a/interface/interface.c
++++ b/interface/interface.c
+@@ -118,7 +118,7 @@ long cdda_read_timed(cdrom_drive *d, void *buffer, long beginsector, long sector
+ 	if(d->bigendianp==-1) /* not determined yet */
+ 	  d->bigendianp=data_bigendianp(d);
+ 	
+-	if(d->bigendianp!=bigendianp()){
++	if(buffer && d->bigendianp!=bigendianp()){
+ 	  int i;
+ 	  u_int16_t *p=(u_int16_t *)buffer;
+ 	  long els=sectors*CD_FRAMESIZE_RAW/2;
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/0001-utils-Use-c99-compiler-independent-types.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/0001-utils-Use-c99-compiler-independent-types.patch
new file mode 100644
index 0000000..7699017
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/0001-utils-Use-c99-compiler-independent-types.patch
@@ -0,0 +1,49 @@
+From 89071cbc8d3ab9a15503f397580b7590338e5e91 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 12 Jul 2017 17:23:45 -0700
+Subject: [PATCH] utils: Use c99 compiler independent types
+
+Make it portable across different platforms
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ utils.h | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/utils.h b/utils.h
+index 10dce58..73bba92 100644
+--- a/utils.h
++++ b/utils.h
+@@ -3,6 +3,7 @@
+ #include <stdio.h>
+ #include <errno.h>
+ #include <string.h>
++#include <stdint.h>
+ 
+ extern long buffering_write(int outf, char *buffer, long num);
+ extern int buffering_close(int fd);
+@@ -18,15 +19,15 @@ static inline int bigendianp(void){
+ }
+ 
+ static inline int32_t swap32(int32_t x){
+-  return((((u_int32_t)x & 0x000000ffU) << 24) | 
+-	 (((u_int32_t)x & 0x0000ff00U) <<  8) | 
+-	 (((u_int32_t)x & 0x00ff0000U) >>  8) | 
+-	 (((u_int32_t)x & 0xff000000U) >> 24));
++  return((((uint32_t)x & 0x000000ffU) << 24) | 
++	 (((uint32_t)x & 0x0000ff00U) <<  8) | 
++	 (((uint32_t)x & 0x00ff0000U) >>  8) | 
++	 (((uint32_t)x & 0xff000000U) >> 24));
+ }
+ 
+ static inline int16_t swap16(int16_t x){
+-  return((((u_int16_t)x & 0x00ffU) <<  8) | 
+-	 (((u_int16_t)x & 0xff00U) >>  8));
++  return((((uint16_t)x & 0x00ffU) <<  8) | 
++	 (((uint16_t)x & 0xff00U) >>  8));
+ }
+ 
+ #if BYTE_ORDER == LITTLE_ENDIAN
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/0002-Fix-printf-format-errors.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/0002-Fix-printf-format-errors.patch
new file mode 100644
index 0000000..024479c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/0002-Fix-printf-format-errors.patch
@@ -0,0 +1,32 @@
+From f4f81bdadb9515938b3b5d13707bd4b9322fd967 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 26 Jun 2017 22:37:13 -0700
+Subject: [PATCH 2/2] Fix printf format errors
+
+error: format not a string literal and no format arguments
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ main.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/main.c b/main.c
+index 664acac..d568fb1 100644
+--- a/main.c
++++ b/main.c
+@@ -588,10 +588,10 @@ static void callback(long inpos, int function){
+ 	    buffer[aheadposition+19]='>';
+ 	}
+    
+-	fprintf(stderr,buffer);
++	fprintf(stderr, "%s", buffer);
+        
+ 	if (logfile != NULL && function==-1) {
+-	  fprintf(logfile,buffer+1);
++	  fprintf(logfile, "%s", buffer+1);
+ 	  fprintf(logfile,"\n\n");
+ 	  fflush(logfile);
+ 	}
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/dont-use-internal-configs.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/dont-use-internal-configs.patch
new file mode 100644
index 0000000..9b268b7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/dont-use-internal-configs.patch
@@ -0,0 +1,30 @@
+Index: cdparanoia-III-10.2/configure.in
+===================================================================
+--- cdparanoia-III-10.2.orig/configure.in
++++ cdparanoia-III-10.2/configure.in
+@@ -1,13 +1,8 @@
+ AC_INIT(interface/interface.c)
+ 
+-cp $srcdir/configure.guess $srcdir/config.guess
+-cp $srcdir/configure.sub $srcdir/config.sub
+-
+ AC_CANONICAL_HOST
+ 
+-if test -z "$CC"; then
+-	AC_PROG_CC	
+-fi
++AC_PROG_CC
+ AC_PROG_RANLIB
+ AC_CHECK_PROG(AR,ar,ar)
+ AC_CHECK_PROG(INSTALL,install,install)
+@@ -44,8 +39,8 @@ case 4 in
+ 	$ac_cv_sizeof_long) SIZE32="long";;
+ esac
+ 
+-AC_CHECK_TYPE(int16_t,SIZE16="int16_t",,)
+-AC_CHECK_TYPE(int32_t,SIZE32="size32_t",,)
++AC_CHECK_TYPES([int16_t], [SIZE16="int16_t"], [], [[#include <stdint.h>]])
++AC_CHECK_TYPES([int32_t], [SIZE32="int32_t"], [], [[#include <stdint.h>]])
+ 
+ if test -z "$SIZE16"; then
+ 	AC_MSG_ERROR(No 16 bit type found on this platform!)
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/out-of-tree-build.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/out-of-tree-build.patch
new file mode 100644
index 0000000..06ee820
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/cdparanoia/files/out-of-tree-build.patch
@@ -0,0 +1,42 @@
+Index: cdparanoia-III-10.2/Makefile.in
+===================================================================
+--- cdparanoia-III-10.2.orig/Makefile.in
++++ cdparanoia-III-10.2/Makefile.in
+@@ -6,6 +6,8 @@
+ VERSION=10.2
+ VPATH=@srcdir@
+ srcdir=@srcdir@
++top_srcdir=@top_srcdir@
++top_builddir=@top_builddir@
+ 
+ @SET_MAKE@
+ FLAGS=@TYPESIZES@ @CFLAGS@
+@@ -64,19 +66,19 @@ slib:
+ 
+ install:
+ 	$(INSTALL) -d -m 0755 $(DESTDIR)$(BINDIR)
+-	$(INSTALL) -m 755 $(srcdir)/cdparanoia $(DESTDIR)$(BINDIR)
++	$(INSTALL) -m 755 $(top_builddir)/cdparanoia $(DESTDIR)$(BINDIR)
+ 	$(INSTALL) -d -m 0755 $(DESTDIR)$(MANDIR)
+ 	$(INSTALL) -d -m 0755 $(DESTDIR)$(MANDIR)/man1
+-	$(INSTALL) -m 0644 $(srcdir)/cdparanoia.1 $(DESTDIR)$(MANDIR)/man1
++	$(INSTALL) -m 0644 $(top_srcdir)/cdparanoia.1 $(DESTDIR)$(MANDIR)/man1
+ 	$(INSTALL) -d -m 0755 $(DESTDIR)$(INCLUDEDIR)
+-	$(INSTALL) -m 0644 $(srcdir)/paranoia/cdda_paranoia.h $(DESTDIR)$(INCLUDEDIR)
++	$(INSTALL) -m 0644 $(top_srcdir)/paranoia/cdda_paranoia.h $(DESTDIR)$(INCLUDEDIR)
+ 	$(INSTALL) -d -m 0755 $(DESTDIR)$(LIBDIR)
+-	$(INSTALL) -m 0644 $(srcdir)/paranoia/libcdda_paranoia.so.0.$(VERSION) $(DESTDIR)$(LIBDIR)
+-	$(INSTALL) -m 0644 $(srcdir)/paranoia/libcdda_paranoia.a $(DESTDIR)$(LIBDIR)
+-	$(INSTALL) -m 0644 $(srcdir)/interface/cdda_interface.h $(DESTDIR)$(INCLUDEDIR)
+-	$(INSTALL) -m 0644 $(srcdir)/interface/libcdda_interface.so.0.$(VERSION) $(DESTDIR)$(LIBDIR)
+-	$(INSTALL) -m 0644 $(srcdir)/interface/libcdda_interface.a $(DESTDIR)$(LIBDIR)
+-	$(INSTALL) -m 0644 $(srcdir)/utils.h $(DESTDIR)$(INCLUDEDIR)
++	$(INSTALL) -m 0644 $(top_builddir)/paranoia/libcdda_paranoia.so.0.$(VERSION) $(DESTDIR)$(LIBDIR)
++	$(INSTALL) -m 0644 $(top_builddir)/paranoia/libcdda_paranoia.a $(DESTDIR)$(LIBDIR)
++	$(INSTALL) -m 0644 $(top_srcdir)/interface/cdda_interface.h $(DESTDIR)$(INCLUDEDIR)
++	$(INSTALL) -m 0644 $(top_builddir)/interface/libcdda_interface.so.0.$(VERSION) $(DESTDIR)$(LIBDIR)
++	$(INSTALL) -m 0644 $(top_builddir)/interface/libcdda_interface.a $(DESTDIR)$(LIBDIR)
++	$(INSTALL) -m 0644 $(top_srcdir)/utils.h $(DESTDIR)$(INCLUDEDIR)
+ 	ln -fs libcdda_interface.so.0.$(VERSION) \
+ 		$(DESTDIR)$(LIBDIR)/libcdda_interface.so.0
+ 	ln -fs libcdda_interface.so.0.$(VERSION) \
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/coriander/coriander_2.0.2.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/coriander/coriander_2.0.2.bb
index a9f52ca..1ddd9aa 100755
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/coriander/coriander_2.0.2.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/coriander/coriander_2.0.2.bb
@@ -5,7 +5,7 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
 DEPENDS = "gtk+ libgnomeui libraw1394 libdc1394 libxv tiff"
 
-PNBLACKLIST[coriander] ?= "BROKEN: fails to use SDL probably because libsdl-config was removed, error: unknown type name 'SDL_Overlay'"
+PNBLACKLIST[coriander] ?= "BROKEN: fails to use SDL probably because libsdl-config was removed, error: unknown type name 'SDL_Overlay' - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/project/${BPN}/coriander-2/${PV}/${BP}.tar.gz \
            file://cross-compile.patch \
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/dca/dcadec_0.2.0.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/dca/dcadec_0.2.0.bb
new file mode 100644
index 0000000..45b53c1
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/dca/dcadec_0.2.0.bb
@@ -0,0 +1,17 @@
+SUMMARY = "DTS Coherent Acoustics decoder with support for HD extensions"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING.LGPLv2.1;md5=4fbd65380cdd255951079008b364516c"
+
+SRCREV = "b93deed1a231dd6dd7e39b9fe7d2abe05aa00158"
+SRC_URI = "git://github.com/foo86/dcadec.git;protocol=http"
+
+S = "${WORKDIR}/git"
+
+inherit lib_package
+
+EXTRA_OEMAKE = "CONFIG_SHARED=1"
+
+do_install() {
+	oe_runmake install DESTDIR="${D}" PREFIX="${prefix}"
+}
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/dleyna/renderer-service-upnp_0.3.0.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/dleyna/renderer-service-upnp_0.3.0.bb
index 68d59fa..4d06d2c 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/dleyna/renderer-service-upnp_0.3.0.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/dleyna/renderer-service-upnp_0.3.0.bb
@@ -5,7 +5,7 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
                     file://src/renderer-service-upnp.c;beginline=1;endline=21;md5=c25c3082684eb4ca87474b7528c6dc15"
 
-PNBLACKLIST[renderer-service-upnp] ?= "BROKEN: doesn't build with B!=S (trying to install rendererconsole.py from ${B} instead of ${S})"
+PNBLACKLIST[renderer-service-upnp] ?= "BROKEN: doesn't build with B!=S (trying to install rendererconsole.py from ${B} instead of ${S}) - the recipe will be removed on 2017-09-01 unless the issue is fixed"
 
 DEPENDS = "dbus glib-2.0 gssdp gupnp gupnp-av gupnp-dlna libsoup-2.4"
 
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/faac/faac_1.28.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/faac/faac_1.28.bb
index 2f048af..5c9477f 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/faac/faac_1.28.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/faac/faac_1.28.bb
@@ -9,11 +9,15 @@
 SRC_URI = "${SOURCEFORGE_MIRROR}/faac/${BP}.tar.gz \
            file://build-fix.patch \
            file://address-gcc-6-narrowing-errors.patch \
-"
+           file://0001-frontend-Fix-format-string-security-error.patch \
+           file://0002-mp4v2-Define-__STRING-if-cdefs.h-does-not-exist.patch \
+           "
 
 SRC_URI[md5sum] = "80763728d392c7d789cde25614c878f6"
 SRC_URI[sha256sum] = "c5141199f4cfb17d749c36ba8cfe4b25f838da67c22f0fec40228b6b9c3d19df"
 
+EXTRA_OECONF += "--without-mp4v2"
+
 PACKAGES =+ "lib${BPN} lib${BPN}-dev"
 
 FILES_${PN} = " ${bindir}/faac "
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/faac/files/0001-frontend-Fix-format-string-security-error.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/faac/files/0001-frontend-Fix-format-string-security-error.patch
new file mode 100644
index 0000000..75e003e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/faac/files/0001-frontend-Fix-format-string-security-error.patch
@@ -0,0 +1,26 @@
+From c1d7a8b992dc36d0012cc3d54b7d3abf4ad4d5d8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 21:33:01 -0700
+Subject: [PATCH 1/2] frontend: Fix format string security error
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ frontend/main.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/frontend/main.c b/frontend/main.c
+index 02146a8..cb9329c 100644
+--- a/frontend/main.c
++++ b/frontend/main.c
+@@ -715,7 +715,7 @@ int main(int argc, char *argv[])
+         break;
+ #endif
+         case 'L':
+-        fprintf(stderr, faac_copyright_string);
++        fprintf(stderr, "%s", faac_copyright_string);
+         dieMessage = license;
+         break;
+     case 'X':
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/faac/files/0002-mp4v2-Define-__STRING-if-cdefs.h-does-not-exist.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/faac/files/0002-mp4v2-Define-__STRING-if-cdefs.h-does-not-exist.patch
new file mode 100644
index 0000000..d845ddf
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/faac/files/0002-mp4v2-Define-__STRING-if-cdefs.h-does-not-exist.patch
@@ -0,0 +1,28 @@
+From 46cc9298c38b9dd735fec3f39aa2d6e56a362410 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 21:33:36 -0700
+Subject: [PATCH 2/2] mp4v2: Define __STRING if cdefs.h does not exist
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ common/mp4v2/mp4util.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/common/mp4v2/mp4util.h b/common/mp4v2/mp4util.h
+index 1f9cb64..1e7aced 100644
+--- a/common/mp4v2/mp4util.h
++++ b/common/mp4v2/mp4util.h
+@@ -23,6 +23,10 @@
+ #define __MP4_UTIL_INCLUDED__
+ #include <assert.h>
+ 
++#ifndef __STRING
++#define __STRING(x)     #x
++#endif
++
+ #ifndef ASSERT
+ #define ASSERT(expr) \
+ 	if (!(expr)) { \
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_1.1.6.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_1.1.6.bb
index 54e8697..88981e4 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_1.1.6.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/fluidsynth/fluidsynth_1.1.6.bb
@@ -12,7 +12,7 @@
 
 inherit autotools-brokensep pkgconfig lib_package
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)}"
 PACKAGECONFIG[sndfile] = "--enable-libsndfile-support,--disable-libsndfile-support,libsndfile1"
 PACKAGECONFIG[jack] = "--enable-jack-support,--disable-jack-support,jack"
 PACKAGECONFIG[pulseaudio] = "--enable-pulse-support,--disable-pulse-support,pulseaudio"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-ffmpeg_0.10.13.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-ffmpeg_0.10.13.bb
index 891b10c..ca19fd6 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-ffmpeg_0.10.13.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-ffmpeg_0.10.13.bb
@@ -100,4 +100,4 @@
 FILES_${PN}-staticdev += "${libdir}/gstreamer-0.10/*.a"
 
 # http://errors.yoctoproject.org/Errors/Details/40736/
-PNBLACKLIST[gst-ffmpeg] ?= "Not compatible with currently used ffmpeg 3"
+PNBLACKLIST[gst-ffmpeg] ?= "Not compatible with currently used ffmpeg 3 - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-bad_0.10.23.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-bad_0.10.23.bb
index f8e77e1..38fccc8 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-bad_0.10.23.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-bad_0.10.23.bb
@@ -43,6 +43,7 @@
 PACKAGECONFIG[voamrwbenc] = "--enable-voamrwbenc,--disable-voamrwbenc,vo-amrwbenc"
 PACKAGECONFIG[voaacenc] = "--enable-voaacenc,--disable-voaacenc,vo-aacenc"
 PACKAGECONFIG[resindvd] = "--enable-resindvd,--disable-resindvd,libdvdnav libdvdread"
+PACKAGECONFIG[zbar] = "--enable-zbar,--disable-zbar,zbar jpeg"
 
 ARM_INSTRUCTION_SET = "arm"
 
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-base_0.10.36.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-base_0.10.36.bb
index eefd993..a3bfa5f 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-base_0.10.36.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-base_0.10.36.bb
@@ -23,7 +23,7 @@
 
 EXTRA_OECONF += "--disable-freetypetest"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"
 
 PACKAGECONFIG[gnomevfs] = "--enable-gnome_vfs,--disable-gnome_vfs,gnome-vfs"
 PACKAGECONFIG[orc] = "--enable-orc,--disable-orc,orc"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-good_0.10.31.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-good_0.10.31.bb
index 7e4a525..f993cfc 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-good_0.10.31.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gst-plugins-good_0.10.31.bb
@@ -8,8 +8,7 @@
 PR = "r8"
 
 PACKAGECONFIG ?= "jpeg v4l \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio x11', d)} \
 "
 PACKAGECONFIG[pulseaudio] = "--enable-pulse,--disable-pulse,pulseaudio"
 PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gstreamer-0.10.36/0002-gst-glib2.m4-don-t-do-crazy-things-to-GLIB_CFLAGS.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gstreamer-0.10.36/0002-gst-glib2.m4-don-t-do-crazy-things-to-GLIB_CFLAGS.patch
new file mode 100644
index 0000000..8db3966
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gstreamer-0.10.36/0002-gst-glib2.m4-don-t-do-crazy-things-to-GLIB_CFLAGS.patch
@@ -0,0 +1,32 @@
+From 4b145ceb22bbce7ba6e209c6ab61f2d5867e69f9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Tue, 1 Nov 2016 19:02:30 +0100
+Subject: [PATCH] gst-glib2.m4: don't do crazy things to GLIB_CFLAGS
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+we are definitely not one of those poor souls mentioned
+
+Upstream-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ common/m4/gst-glib2.m4 | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/common/m4/gst-glib2.m4 b/common/m4/gst-glib2.m4
+index b01f02f..4569ae5 100644
+--- a/common/m4/gst-glib2.m4
++++ b/common/m4/gst-glib2.m4
+@@ -69,7 +69,6 @@ AC_DEFUN([AG_GST_GLIB_CHECK],
+   fi
+ 
+   dnl for the poor souls who for example have glib in /usr/local
+-  AS_SCRUB_INCLUDE(GLIB_CFLAGS)
+ 
+   AC_SUBST(GLIB_EXTRA_CFLAGS)
+ ])
+-- 
+2.5.5
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gstreamer_0.10.36.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gstreamer_0.10.36.bb
index e3bd5e5..5f97a20 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gstreamer_0.10.36.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer-0.10/gstreamer_0.10.36.bb
@@ -7,7 +7,7 @@
 LICENSE = "LGPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=55ca817ccb7d5b5b66355690e9abc605 \
                     file://gst/gst.h;beginline=1;endline=21;md5=8e5fe5e87d33a04479fde862e238eaa4"
-DEPENDS = "glib-2.0 libxml2 bison-native flex-native"
+DEPENDS = "glib-2.0 libxml2 bison-native flex-native glib-2.0-native"
 
 PR = "r2"
 
@@ -16,6 +16,7 @@
            file://gst-inspect-check-error.patch \
            file://0001-baseparse-Fix-self-comparison-always-evaluates-to-tr.patch \
            file://0001-parse-make-grammar.y-work-with-Bison-3.patch \
+           file://0002-gst-glib2.m4-don-t-do-crazy-things-to-GLIB_CFLAGS.patch \
 "
 
 SRC_URI[md5sum] = "a0cf7d6877f694a1a2ad2b4d1ecb890b"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer/gst123_0.3.1.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer/gst123_0.3.1.bb
index 47f1d9f..9fe1bc6 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer/gst123_0.3.1.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/gstreamer/gst123_0.3.1.bb
@@ -14,4 +14,4 @@
 
 inherit autotools
 
-PNBLACKLIST[gst123] ?= "gst123 is still "sometimes" using wrong sysroot"
+PNBLACKLIST[gst123] ?= "gst123 is still "sometimes" using wrong sysroot - the recipe will be removed on 2017-09-01 unless the issue is fixed"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libao/libao_1.2.0.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libao/libao_1.2.0.bb
index 1339df6..4c0976e 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libao/libao_1.2.0.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libao/libao_1.2.0.bb
@@ -27,7 +27,7 @@
     do_split_packages(d, rootdir_dbg, '^(.*)\.so$', output_pattern='${BPN}-plugin-%s-dbg', description='AO %s plugin debug data')
 }
 
-PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)}"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'alsa pulseaudio', d)}"
 PACKAGECONFIG[esound] = "--enable-esd,--disable-esd,esound"
 PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib"
 PACKAGECONFIG[pulseaudio] = "--enable-pulse,--disable-pulse,pulseaudio"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libavc1394/libavc1394_0.5.4.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libavc1394/libavc1394_0.5.4.bb
index 97e2bf1..f5b0d48 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libavc1394/libavc1394_0.5.4.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libavc1394/libavc1394_0.5.4.bb
@@ -4,6 +4,7 @@
 SECTION = "libs/multimedia"
 
 DEPENDS = "libraw1394"
+DEPENDS_append_libc-musl = " argp-standalone"
 
 LICENSE = "LGPLv2.1"
 LIC_FILES_CHKSUM = "file://COPYING;md5=dcf3c825659e82539645da41a7908589"
@@ -13,3 +14,5 @@
 SRC_URI[sha256sum] = "7cb1ff09506ae911ca9860bef4af08c2403f3e131f6c913a2cbd6ddca4215b53"
 
 inherit autotools pkgconfig
+
+LDFLAGS_append_libc-musl = " -largp"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libdc1394/libdc1394_git.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libdc1394/libdc1394_git.bb
index c298b44..8a9e9a1 100755
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libdc1394/libdc1394_git.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libdc1394/libdc1394_git.bb
@@ -5,11 +5,14 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=c848e78d9a4a5cc69906178e4d6fbd64"
 
 # libsdl to provide sdl.m4 with AM_PATH_SDL
-DEPENDS += "libusb1 libraw1394 libsdl"
+DEPENDS += "libusb1 libraw1394 libsdl \
+            ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'libxv virtual/libx11', '', d)} \
+            ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virtual/libgl libglu', '', d)} \
+"
 
-PV = "2.2.4+gitr${SRCPV}"
+PV = "2.2.5+gitr${SRCPV}"
 
-SRCREV = "9ac63fe7a7561bea83bfd4a5db47d4d74fde43a6"
+SRCREV = "5e78f51936fd09db0c0f742c7d2c0e5bdbbeed56"
 
 SRC_URI = "git://git.code.sf.net/p/libdc1394/code;branch=master;protocol=git \
            file://install_examples.patch \
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libsquish/libsquish_git.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libsquish/libsquish_git.bb
new file mode 100644
index 0000000..f060f1e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/libsquish/libsquish_git.bb
@@ -0,0 +1,19 @@
+SUMMARY = "The squish library (abbreviated to libsquish) is an open source DXT compression library written in C++ "
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://alpha.cpp;beginline=3;endline=22;md5=6665e479f71feb92d590ea9ae9b9f6d5"
+
+PV = "1.10+git${SRCPV}"
+
+SRCREV = "52e7d93c5947f72380521116c05d97c528863ba8"
+SRC_URI = "git://github.com/OpenELEC/libsquish.git;protocol=https"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OEMAKE = "INSTALL_DIR=${D}${prefix}"
+
+do_install() {
+	install -d ${D}${includedir}
+	install -d ${D}${libdir}/pkgconfig
+	oe_runmake install 
+}
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb
index a6a4f6a..16e5213 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb
@@ -3,19 +3,16 @@
 HOMEPAGE = "http://musicbrainz.org"
 LICENSE = "LGPLv2.1+"
 LIC_FILES_CHKSUM = "file://COPYING.txt;md5=fbc093901857fcd118f065f900982c24"
-DEPENDS = "expat neon neon-native"
+DEPENDS = "expat libxml2 libxml2-native neon neon-native"
 
-PV = "5.0.1+git${SRCPV}"
-PR = "r1"
+PV = "5.1.0+git${SRCPV}"
 
-SRCREV = "0749dd0a35b4a54316da064475863a4ac6e28e7e"
+SRCREV = "44c05779dd996035758f5ec426766aeedce29cc3"
 SRC_URI = "git://github.com/metabrainz/libmusicbrainz.git \
            file://allow-libdir-override.patch "
 
 S = "${WORKDIR}/git"
 
-LDFLAGS_prepend_libc-uclibc = " -lpthread "
-
 inherit cmake pkgconfig
 
 do_configure_prepend() {
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/musicpd/mpd_0.19.15.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/musicpd/mpd_0.19.21.bb
similarity index 72%
rename from import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/musicpd/mpd_0.19.15.bb
rename to import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/musicpd/mpd_0.19.21.bb
index 0fed867..c16f3be 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/musicpd/mpd_0.19.15.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/musicpd/mpd_0.19.21.bb
@@ -3,20 +3,54 @@
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
 HOMEPAGE ="http://www.musicpd.org"
 
-DEPENDS = "alsa-lib libsamplerate0 libsndfile1 libvorbis libogg faad2 ffmpeg curl sqlite bzip2 pulseaudio tcp-wrappers openal-soft yajl jack faad2 flac libao fluidsynth libcdio wavpack libopus mpg123 libmms libmodplug boost icu dbus expat zlib libupnp"
+inherit autotools useradd systemd pkgconfig
+
+DEPENDS += " \
+    alsa-lib \
+    libsamplerate0 \
+    libsndfile1 \
+    libvorbis \
+    libogg \
+    faad2 \
+    ffmpeg \
+    curl \
+    sqlite \
+    bzip2 \
+    pulseaudio \
+    tcp-wrappers \
+    openal-soft \
+    yajl \
+    jack \
+    faad2 \
+    flac \
+    libao \
+    fluidsynth \
+    libcdio \
+    wavpack \
+    libopus \
+    mpg123 \
+    libmms \
+    libmodplug \
+    boost \
+    icu \
+    dbus \
+    expat \
+    zlib \
+    libupnp \
+"
 
 SRC_URI = " \
     http://www.musicpd.org/download/${BPN}/0.19/${BP}.tar.xz \
     file://mpd.conf.in \
 "
-SRC_URI[md5sum] = "bb855b1689c9e863c2dd214ab1cb9344"
-SRC_URI[sha256sum] = "0cb9a223894b038ce966ce6d651d9b3ea3bdc7d7b9bec8d1e9e7e091cbc29b8b"
-
-inherit autotools useradd systemd
+SRC_URI[md5sum] = "fc19f76b512bd471b6af5214965ff7c5"
+SRC_URI[sha256sum] = "8305b8bc026f4b6bde28b8dd09bfdddbe5590acf36358eed4d083a396e301730"
 
 EXTRA_OECONF = "enable_bzip2=yes"
 EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}"
 
+PACKAGECONFIG[audiofile] = "--enable-audiofile,--disable-audiofile,audiofile"
+PACKAGECONFIG[cdioparanoia] = "--enable-cdio-paranoia,--disable-cdio-paranoia,libcdio-paranoia"
 PACKAGECONFIG[mad] = "--enable-mad,--disable-mad,libmad"
 PACKAGECONFIG[id3tag] = "--enable-id3,--disable-id3,libid3tag"
 PACKAGECONFIG[lame] = "--enable-lame-encoder,--disable-lame-encoder,lame"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/openal/openal-soft_1.15.1.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/openal/openal-soft_1.15.1.bb
index 5895234..e0f1a26 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/openal/openal-soft_1.15.1.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/openal/openal-soft_1.15.1.bb
@@ -9,10 +9,7 @@
 SRC_URI[md5sum] = "ea83dec3b9655a27d28e7bc7cae9cd71"
 SRC_URI[sha256sum] = "0e29a162f0841ccb4135ce76e92e8a704589b680a85eddf76f898de5236eb056"
 
-PACKAGECONFIG ?= "\
-    ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
-    ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
-"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'alsa pulseaudio', d)}"
 PACKAGECONFIG[alsa] = "-DALSA=TRUE, -DALSA=FALSE, alsa-lib"
 PACKAGECONFIG[pulseaudio] = "-DPULSEAUDIO=TRUE, -DPULSEAUDIO=FALSE, pulseaudio"
 # currently doesn't work with libav-9
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/sox/sox/0001-remove-the-error-line-and-live-without-file-type-det.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/sox/sox/0001-remove-the-error-line-and-live-without-file-type-det.patch
new file mode 100644
index 0000000..605863a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/sox/sox/0001-remove-the-error-line-and-live-without-file-type-det.patch
@@ -0,0 +1,28 @@
+From c2aed28e3e14329ad0a8c4371fdcce9934013f21 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 12 Jul 2017 16:36:06 -0700
+Subject: [PATCH] remove the #error line and live without file-type detection
+ with pipes
+
+this fallback is executed with musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/formats.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/formats.c b/src/formats.c
+index 7e231ca..b13f0d5 100644
+--- a/src/formats.c
++++ b/src/formats.c
+@@ -416,7 +416,6 @@ static void UNUSED rewind_pipe(FILE * fp)
+   /* To fix this #error, either simply remove the #error line and live without
+    * file-type detection with pipes, or add support for your compiler in the
+    * lines above.  Test with cat monkey.au | ./sox --info - */
+-  #error FIX NEEDED HERE
+   #define NO_REWIND_PIPE
+   (void)fp;
+ #endif
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/sox/sox_14.4.0.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/sox/sox_14.4.0.bb
index 4b73aa3..e115f1c 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/sox/sox_14.4.0.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/sox/sox_14.4.0.bb
@@ -8,8 +8,7 @@
 
 PR = "r2"
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'alsa pulseaudio', d)} \
                    magic \
 "
 PACKAGECONFIG[pulseaudio] = "--with-pulseaudio=dyn,--with-pulseaudio=no,pulseaudio,"
@@ -28,7 +27,9 @@
 LIC_FILES_CHKSUM = "file://LICENSE.GPL;md5=751419260aa954499f7abaabaa882bbe \
                     file://LICENSE.LGPL;md5=fbc093901857fcd118f065f900982c24"
 
-SRC_URI = "${SOURCEFORGE_MIRROR}/sox/sox-${PV}.tar.gz"
+SRC_URI = "${SOURCEFORGE_MIRROR}/sox/sox-${PV}.tar.gz \
+           file://0001-remove-the-error-line-and-live-without-file-type-det.patch \
+           "
 SRC_URI[md5sum] = "b0c15cff7a4ba0ec17fdc74e6a1f9cf1"
 SRC_URI[sha256sum] = "3ee34b14dd267de378e8a117aae81ec4cae330772342e6a55bbf6520a0a88aa3"
 
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper/0001-build-these-are-foreign-automake-projects.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper/0001-build-these-are-foreign-automake-projects.patch
new file mode 100644
index 0000000..c0f4692
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper/0001-build-these-are-foreign-automake-projects.patch
@@ -0,0 +1,49 @@
+From 4c7165b3fbc0e99e7cdd77031e8a001440d0629d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net>
+Date: Thu, 3 Nov 2016 20:53:21 +0000
+Subject: [PATCH 1/3] build: these are 'foreign' automake projects
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In order to prevent automake from complaining about missing
+
+files ChangeLog, AUTHORS, etc., use the 'foreign' automake
+option to instruct it so.
+
+Upstream-Status: Inappropriate [no upstream activity for 7+ years]
+Signed-off-by: André Draszik <git@andred.net>
+---
+ configure.ac                | 2 +-
+ libmad-0.15.1b/configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b12d11f..96300d6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -11,7 +11,7 @@ dnl   AC_CHECK_FUNC:  defines a shell variable
+ 
+ AC_PREREQ(2.59)
+ AC_INIT(streamripper,1.64.6)
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([foreign])
+ 
+ AC_CONFIG_HEADERS([lib/config.h])
+ 
+diff --git a/libmad-0.15.1b/configure.ac b/libmad-0.15.1b/configure.ac
+index 8fb35ee..ab116a6 100644
+--- a/libmad-0.15.1b/configure.ac
++++ b/libmad-0.15.1b/configure.ac
+@@ -26,7 +26,7 @@ AC_PREREQ(2.53)
+ 
+ AC_CONFIG_SRCDIR([decoder.h])
+ 
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([foreign])
+ 
+ AM_CONFIG_HEADER([config.h])
+ 
+-- 
+2.10.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper/0002-build-don-t-ignore-CPPFLAGS-from-environment.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper/0002-build-don-t-ignore-CPPFLAGS-from-environment.patch
new file mode 100644
index 0000000..58473f6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper/0002-build-don-t-ignore-CPPFLAGS-from-environment.patch
@@ -0,0 +1,30 @@
+From 2fcf2b164e25c4b2523dea4b04094916e57ba19e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net>
+Date: Thu, 3 Nov 2016 20:53:26 +0000
+Subject: [PATCH 2/3] build: don't ignore CPPFLAGS from environment
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Inappropriate [no upstream activity for 7+ years]
+Signed-off-by: André Draszik <git@andred.net>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 96300d6..1600c88 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -56,7 +56,7 @@ AC_ARG_WITH(curses,
+   [  --with-curses(=XXX) compile curses front-end (XXX is curses (default), ncurses, ncursesw, pdcurses or slang)])
+ 
+ 
+-CPPFLAGS="-D__UNIX__"
++CPPFLAGS="$CPPFLAGS -D__UNIX__"
+ AC_SUBST(CPPFLAGS)
+ 
+ 
+-- 
+2.10.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper/0003-ripstream-fix-compilation.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper/0003-ripstream-fix-compilation.patch
new file mode 100644
index 0000000..065254e
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper/0003-ripstream-fix-compilation.patch
@@ -0,0 +1,42 @@
+From 6d59b60ff5108357ad2c2951a97112e713ee5368 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net>
+Date: Thu, 3 Nov 2016 20:53:32 +0000
+Subject: [PATCH 3/3] ripstream: fix compilation
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+| ../../streamripper-1.64.6/lib/ripstream.c: In function 'write_id3v2_frame':
+| ../../streamripper-1.64.6/lib/ripstream.c:717:5: error: unknown type name '__uint32_t'
+|      __uint32_t framesize = 0;
+|      ^~~~~~~~~~
+
+The already included srtypes.h does the right thing for all
+platforms (I think). It certainly works well here.
+
+Upstream-Status: Inappropriate [no upstream activity for 7+ years]
+Signed-off-by: André Draszik <git@andred.net>
+---
+ lib/ripstream.c | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/lib/ripstream.c b/lib/ripstream.c
+index c671e18..7f311c6 100644
+--- a/lib/ripstream.c
++++ b/lib/ripstream.c
+@@ -713,11 +713,7 @@ write_id3v2_frame(RIP_MANAGER_INFO* rmi, char* tag_name, mchar* data,
+     int rc;
+     char bigbuf[HEADER_SIZE] = "";
+     ID3V2frame id3v2frame;
+-#ifndef WIN32
+-    __uint32_t framesize = 0;
+-#else
+-    unsigned long int framesize = 0;
+-#endif
++    uint32_t framesize = 0;
+ 
+     memset(&id3v2frame, '\000', sizeof(id3v2frame));
+     strncpy(id3v2frame.id, tag_name, 4);
+-- 
+2.10.1
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper_1.64.6.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper_1.64.6.bb
new file mode 100644
index 0000000..94355b6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/streamripper/streamripper_1.64.6.bb
@@ -0,0 +1,29 @@
+SUMMARY = "download online streams into audio files"
+DESCRIPTION = "This command-line tool can be used to record MPEG III \
+and OGG online radio-streams into track-separated audio files."
+HOMEPAGE = "http://streamripper.sourceforge.net"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+DEPENDS = "glib-2.0 libmad libogg libvorbis"
+
+SRC_URI = "\
+    ${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
+    file://0001-build-these-are-foreign-automake-projects.patch \
+    file://0002-build-don-t-ignore-CPPFLAGS-from-environment.patch \
+    file://0003-ripstream-fix-compilation.patch \
+"
+SRC_URI[mdsum] = "a37a1a8b8f9228522196a122a1c2dd32"
+SRC_URI[sha256sum] = "c1d75f2e9c7b38fd4695be66eff4533395248132f3cc61f375196403c4d8de42"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF += "--with-included-argv=yes --with-included-libmad=no"
+EXTRA_OECONF += "\
+    --with-ogg-includes=${STAGING_INCDIR} \
+    --with-ogg-libraries=${STAGING_LIBDIR} \
+    --with-vorbis-includes=${STAGING_INCDIR} \
+    --with-vorbis-libraries=${STAGING_LIBDIR} \
+"
+
+# the included argv library needs this
+CPPFLAGS_append = " -DANSI_PROTOTYPES"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/tremor/tremor/obsolete_automake_macros.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/tremor/tremor/obsolete_automake_macros.patch
new file mode 100644
index 0000000..7e51029
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/tremor/tremor/obsolete_automake_macros.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Submitted [https://trac.xiph.org/ticket/1922]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+Index: configure.in
+===================================================================
+--- configure.in	(revision 18764)
++++ configure.in	(working copy)
+@@ -9,7 +9,7 @@
+ AC_CANONICAL_HOST
+ AC_CANONICAL_TARGET
+
+-AM_CONFIG_HEADER([config.h])
++AC_CONFIG_HEADERS([config.h])
+
+ AM_INIT_AUTOMAKE(libvorbisidec,1.2.1)
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/tremor/tremor/tremor-arm-thumb2.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/tremor/tremor/tremor-arm-thumb2.patch
new file mode 100644
index 0000000..2049542
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/tremor/tremor/tremor-arm-thumb2.patch
@@ -0,0 +1,104 @@
+From: Xin Ouyang <Xin.Ouyang@windriver.com>
+Date: Mon, 16 Jul 2012 13:29:34 +0800
+Subject: [PATCH] tremor: add IT instructions for arm thumb2 tune flags.
+
+Upstream-Status: Pending
+
+In Thumb-2, most instructions do not have a built in condition code (except for 
+conditional branches). Instead, short sequences of instructions which are to be 
+executed conditionally can be preceded by a special "IT instruction" which 
+describes the condition and which of the following instructions should be 
+executed if the condition is false respectively. 
+
+For the ARM/Thumb IT(If-Then) instruction:
+http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0489c/Cjabicci.html
+
+Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
+---
+ asm_arm.h |   14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/asm_arm.h b/asm_arm.h
+index c3bda00..823c54f 100755
+--- a/asm_arm.h
++++ b/asm_arm.h
+@@ -108,9 +108,11 @@ static inline void XNPROD31(ogg_int32_t  a, ogg_int32_t  b,
+ static inline ogg_int32_t CLIP_TO_15(ogg_int32_t x) {
+   int tmp;
+   asm volatile("subs	%1, %0, #32768\n\t"
++	       "itt     pl\n\t"
+ 	       "movpl	%0, #0x7f00\n\t"
+ 	       "orrpl	%0, %0, #0xff\n"
+ 	       "adds	%1, %0, #32768\n\t"
++	       "it      mi\n\t"
+ 	       "movmi	%0, #0x8000"
+ 	       : "+r"(x),"=r"(tmp)
+ 	       :
+@@ -139,10 +141,12 @@ static inline void lsp_loop_asm(ogg_uint32_t *qip,ogg_uint32_t *pip,
+       
+       "ldmdb   r0!,{r1,r3};"
+       "subs    r1,r1,%4;"          //ilsp[j]-wi
++      "it      mi;"
+       "rsbmi   r1,r1,#0;"          //labs(ilsp[j]-wi)
+       "umull   %0,r2,r1,%0;"       //qi*=labs(ilsp[j]-wi)
+       
+       "subs    r1,r3,%4;"          //ilsp[j+1]-wi
++      "it      mi;"
+       "rsbmi   r1,r1,#0;"          //labs(ilsp[j+1]-wi)
+       "umull   %1,r3,r1,%1;"       //pi*=labs(ilsp[j+1]-wi)
+       
+@@ -167,6 +171,7 @@ static inline void lsp_loop_asm(ogg_uint32_t *qip,ogg_uint32_t *pip,
+       "mov     r0,#0x4000;\n"
+       
+       "subs    r1,r1,%4;\n"          //ilsp[j]-wi
++      "it      mi;\n"
+       "rsbmi   r1,r1,#0;\n"          //labs(ilsp[j]-wi)
+       "umull   %0,r2,r1,%0;\n"       //qi*=labs(ilsp[j]-wi)
+       "umull   %1,r3,r0,%1;\n"       //pi*=labs(ilsp[j+1]-wi)
+@@ -190,18 +195,23 @@ static inline void lsp_loop_asm(ogg_uint32_t *qip,ogg_uint32_t *pip,
+       "mov     r2,#0;"
+       "orr     r1,%0,%1;"
+       "tst     r1,#0xff000000;"
++      "itt     ne;"
+       "addne   r2,r2,#8;"
+       "movne   r1,r1,lsr #8;"
+       "tst     r1,#0x00f00000;"
++      "itt     ne;"
+       "addne   r2,r2,#4;"
+       "movne   r1,r1,lsr #4;"
+       "tst     r1,#0x000c0000;"
++      "itt     ne;"
+       "addne   r2,r2,#2;"
+       "movne   r1,r1,lsr #2;"
+       "tst     r1,#0x00020000;"
++      "itt     ne;"
+       "addne   r2,r2,#1;"
+       "movne   r1,r1,lsr #1;"
+       "tst     r1,#0x00010000;"
++      "it      ne;"
+       "addne   r2,r2,#1;"
+       "mov     %0,%0,lsr r2;"
+       "mov     %1,%1,lsr r2;"
+@@ -222,15 +232,19 @@ static inline void lsp_norm_asm(ogg_uint32_t *qip,ogg_int32_t *qexpp){
+   ogg_int32_t qexp=*qexpp;
+ 
+   asm("tst     %0,#0x0000ff00;"
++      "itt     eq;"
+       "moveq   %0,%0,lsl #8;"
+       "subeq   %1,%1,#8;"
+       "tst     %0,#0x0000f000;"
++      "itt     eq;"
+       "moveq   %0,%0,lsl #4;"
+       "subeq   %1,%1,#4;"
+       "tst     %0,#0x0000c000;"
++      "itt     eq;"
+       "moveq   %0,%0,lsl #2;"
+       "subeq   %1,%1,#2;"
+       "tst     %0,#0x00008000;"
++      "itt     eq;"
+       "moveq   %0,%0,lsl #1;"
+       "subeq   %1,%1,#1;"
+       : "+r"(qi),"+r"(qexp)
+-- 
+1.7.9.5
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/tremor/tremor_20150107.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/tremor/tremor_20150107.bb
new file mode 100644
index 0000000..937894a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/tremor/tremor_20150107.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Fixed-point decoder"
+DESCRIPTION = "tremor is a fixed point implementation of the vorbis codec."
+SECTION = "libs"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=db1b7a668b2a6f47b2af88fb008ad555 \
+                    file://os.h;beginline=3;endline=14;md5=5c0af5e1bedef3ce8178c89f48cd6f1f"
+DEPENDS = "libogg"
+SRCDATE = "${PV}"
+PR = "r1"
+
+# SVN support for upstream version check isn't implemented yet
+RECIPE_UPSTREAM_VERSION = "20150107"
+RECIPE_UPSTREAM_DATE = "Jan 07, 2015"
+CHECK_DATE = "Aug 12, 2015"
+
+SRC_URI = "svn://svn.xiph.org/trunk;module=Tremor;rev=19427;protocol=http \
+           file://obsolete_automake_macros.patch;striplevel=0 \
+           file://tremor-arm-thumb2.patch \
+"
+
+S = "${WORKDIR}/Tremor"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--enable-shared"
+
+ARM_INSTRUCTION_SET = "arm"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/vorbis-tools/vorbis-tools/0004-Fix-format-error-blocking-compilation-with-hardening.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/vorbis-tools/vorbis-tools/0004-Fix-format-error-blocking-compilation-with-hardening.patch
new file mode 100644
index 0000000..111e98a
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/vorbis-tools/vorbis-tools/0004-Fix-format-error-blocking-compilation-with-hardening.patch
@@ -0,0 +1,26 @@
+From: Petter Reinholdtsen <pere@hungry.com>
+Date: Wed, 22 Oct 2014 13:25:21 +0200
+Subject: Fix format error blocking compilation with hardening
+
+Last-Update: 2014-10-22
+Forwarded: no
+
+Enabling hardening refuses to compile code with sprintf() calls
+with no formatting string. Adjust the code to work with hardening.
+---
+ ogg123/status.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ogg123/status.c b/ogg123/status.c
+index 92b8ff1..ccec389 100644
+--- a/ogg123/status.c
++++ b/ogg123/status.c
+@@ -148,7 +148,7 @@ int print_statistics_line (stat_format_t stats[])
+ 
+     switch (stats->type) {
+     case stat_noarg:
+-      len += sprintf(str+len, stats->formatstr);
++      len += sprintf(str+len, "%s", stats->formatstr);
+       break;
+     case stat_intarg:
+       len += sprintf(str+len, stats->formatstr, stats->arg.intarg);
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/vorbis-tools/vorbis-tools_1.4.0.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/vorbis-tools/vorbis-tools_1.4.0.bb
index 2683555..e43cb40 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/vorbis-tools/vorbis-tools_1.4.0.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-multimedia/vorbis-tools/vorbis-tools_1.4.0.bb
@@ -12,6 +12,7 @@
 
 SRC_URI = "http://downloads.xiph.org/releases/vorbis/${BP}.tar.gz \
            file://0001-oggenc-Fix-large-alloca-on-bad-AIFF-input.patch \
+           file://0004-Fix-format-error-blocking-compilation-with-hardening.patch \
           "
 
 SRC_URI[md5sum] = "567e0fb8d321b2cd7124f8208b8b90e6"
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-support/gst-instruments/gst-instruments_0.2.3.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-support/gst-instruments/gst-instruments_0.2.3.bb
new file mode 100644
index 0000000..b6cdc4f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-support/gst-instruments/gst-instruments_0.2.3.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Profiling utilities for GStreamer 1.0 pipelines"
+HOMEPAGE = "https://github.com/kirushyk/gst-instruments"
+SECTION = "multimedia"
+
+LICENSE = "LGPL-3.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e6a600fd5e1d9cbde2d983680233ad02"
+
+SRC_URI = "https://github.com/kirushyk/gst-instruments/archive/${PV}.tar.gz"
+
+SRC_URI[md5sum] = "14a394dec25642848b17f9999f1b4999"
+SRC_URI[sha256sum] = "5565658a33ff9596946541304fbdd3b3683dbb82171a0e6ce56f42b64a01e58d"
+
+S = "${WORKDIR}/gst-instruments-${PV}"
+
+FILES_${PN} += "${libdir}/*"
+
+INSANE_SKIP_${PN} = "dev-so"
+
+DEPENDS = "gstreamer1.0"
+
+inherit autotools pkgconfig
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-support/libsrtp/libsrtp/0001-Rename-conflicting-variable-mips.patch b/import-layers/meta-openembedded/meta-multimedia/recipes-support/libsrtp/libsrtp/0001-Rename-conflicting-variable-mips.patch
new file mode 100644
index 0000000..b56c789
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-support/libsrtp/libsrtp/0001-Rename-conflicting-variable-mips.patch
@@ -0,0 +1,73 @@
+From 3dc8a678a844247d0afcf7e30fb3cbd5ccbd828f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 29 Jun 2017 14:05:06 -0700
+Subject: [PATCH] Rename conflicting variable 'mips'
+
+Fixes
+test/srtp_driver.c:344:12: error: expected identifier or '(' before numeric constant
+     double mips = mips_estimate(1000000000, &ignore);
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ test/srtp_driver.c | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/test/srtp_driver.c b/test/srtp_driver.c
+index 8872971..d38ea19 100644
+--- a/test/srtp_driver.c
++++ b/test/srtp_driver.c
+@@ -341,7 +341,7 @@ main (int argc, char *argv[]) {
+   if (do_codec_timing) {
+     srtp_policy_t policy;
+     int ignore;
+-    double mips = mips_estimate(1000000000, &ignore);
++    double est = mips_estimate(1000000000, &ignore);
+ 
+     crypto_policy_set_rtp_default(&policy.rtp);
+     crypto_policy_set_rtcp_default(&policy.rtcp);
+@@ -353,33 +353,33 @@ main (int argc, char *argv[]) {
+     policy.allow_repeat_tx = 0;
+     policy.next = NULL;
+ 
+-    printf("mips estimate: %e\n", mips);
++    printf("mips estimate: %e\n", est);
+ 
+     printf("testing srtp processing time for voice codecs:\n");
+     printf("codec\t\tlength (octets)\t\tsrtp instructions/second\n");
+     printf("G.711\t\t%d\t\t\t%e\n", 80, 
+-           (double) mips * (80 * 8) / 
++           (double) est * (80 * 8) / 
+ 	   srtp_bits_per_second(80, &policy) / .01 );
+     printf("G.711\t\t%d\t\t\t%e\n", 160, 
+-           (double) mips * (160 * 8) / 
++           (double) est * (160 * 8) / 
+ 	   srtp_bits_per_second(160, &policy) / .02);
+     printf("G.726-32\t%d\t\t\t%e\n", 40, 
+-           (double) mips * (40 * 8) / 
++           (double) est * (40 * 8) / 
+ 	   srtp_bits_per_second(40, &policy) / .01 );
+     printf("G.726-32\t%d\t\t\t%e\n", 80, 
+-           (double) mips * (80 * 8) / 
++           (double) est * (80 * 8) / 
+ 	   srtp_bits_per_second(80, &policy) / .02);
+     printf("G.729\t\t%d\t\t\t%e\n", 10, 
+-           (double) mips * (10 * 8) / 
++           (double) est * (10 * 8) / 
+ 	   srtp_bits_per_second(10, &policy) / .01 );
+     printf("G.729\t\t%d\t\t\t%e\n", 20, 
+-           (double) mips * (20 * 8) /
++           (double) est * (20 * 8) /
+ 	   srtp_bits_per_second(20, &policy) / .02 );
+     printf("Wideband\t%d\t\t\t%e\n", 320, 
+-           (double) mips * (320 * 8) /
++           (double) est * (320 * 8) /
+ 	   srtp_bits_per_second(320, &policy) / .01 );
+     printf("Wideband\t%d\t\t\t%e\n", 640, 
+-           (double) mips * (640 * 8) /
++           (double) est * (640 * 8) /
+ 	   srtp_bits_per_second(640, &policy) / .02 );
+   }
+ 
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-multimedia/recipes-support/libsrtp/libsrtp_1.5.2.bb b/import-layers/meta-openembedded/meta-multimedia/recipes-support/libsrtp/libsrtp_1.5.2.bb
index 3249828..8abaa12 100644
--- a/import-layers/meta-openembedded/meta-multimedia/recipes-support/libsrtp/libsrtp_1.5.2.bb
+++ b/import-layers/meta-openembedded/meta-multimedia/recipes-support/libsrtp/libsrtp_1.5.2.bb
@@ -5,7 +5,9 @@
 LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=15bc16b9d2e305974dde47e733883714"
 
-SRC_URI = "https://github.com/cisco/libsrtp/archive/v${PV}.tar.gz;downloadfilename=${BP}.tar.gz"
+SRC_URI = "https://github.com/cisco/libsrtp/archive/v${PV}.tar.gz;downloadfilename=${BP}.tar.gz \
+           file://0001-Rename-conflicting-variable-mips.patch \
+           "
 SRC_URI[md5sum] = "2309aa6027992810a4285b042c71e644"
 SRC_URI[sha256sum] = "86e1efe353397c0751f6bdd709794143bd1b76494412860f16ff2b6d9c304eda"