Sophie

Sophie

distrib > Mageia > 6 > armv7hl > media > tainted-updates-src > by-pkgid > 762dbd22c88b53fdca1bd80563fa1030 > files > 4

gstreamer0.10-plugins-ugly-0.10.19-18.1.mga6.tainted.src.rpm

From 425e6e395f6bcaff77d0393126e1253066ddcd8a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim.muller@collabora.co.uk>
Date: Sat, 3 Mar 2012 17:17:31 +0000
Subject: [PATCH] amrnb, amrwbdec: fix build with opencore-amr >= 0.1.3

In previous versions, the opencore-amr include sub-directory
would be specified in the include path in the CFLAGS, but this
is no longer the case in newer versions, so we need to add those
to our include directives.

Based on patch by: Christian Morales Vega

https://bugzilla.gnome.org/show_bug.cgi?id=671123
---
 configure.ac            |    6 ++++++
 ext/amrnb/amrnbdec.h    |    5 +++++
 ext/amrnb/amrnbenc.h    |    7 ++++++-
 ext/amrwbdec/amrwbdec.h |    6 ++++++
 4 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 3c2e341..18f2904 100644
--- a/configure.ac
+++ b/configure.ac
@@ -248,12 +248,14 @@
 dnl *** amr-nb ***
 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRNB, true)
 AG_GST_CHECK_FEATURE(AMRNB, [amrnb library], amrnb, [
-  PKG_CHECK_MODULES(AMRNB, opencore-amrnb, HAVE_AMRNB="yes",
-      [ AG_GST_CHECK_LIBHEADER(AMRNB, opencore-amrnb,
-		           Decoder_Interface_init, $LIBM,
-		           opencore-amrnb/interf_dec.h,
-			   AMRNB_LIBS="-lopencore-amrnb")
-      ])
+  PKG_CHECK_MODULES(AMRNB, opencore-amrnb, [
+    if $PKG_CONFIG --atleast-version=0.1.3 opencore-amrnb; then
+      AC_DEFINE(HAVE_OPENCORE_AMRNB_0_1_3_OR_LATER, 1, [Defined for newer opencore-amrnb])
+    fi
+    HAVE_AMRNB="yes"
+  ], [
+    HAVE_AMRNB="no"
+  ])
   AC_SUBST(AMRNB_CFLAGS)
   AC_SUBST(AMRNB_LIBS)
 ])
@@ -261,12 +263,14 @@
 dnl *** amr-wb dec ***
 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRWB, true)
 AG_GST_CHECK_FEATURE(AMRWB, [amrwb library], amrwbdec, [
-  PKG_CHECK_MODULES(AMRWB, opencore-amrwb, HAVE_AMRWB="yes",
-      [ AG_GST_CHECK_LIBHEADER(AMRWB, opencore-amrwb,
-			   D_IF_decode, ,
-			   opencore-amrwb/dec_if.h,
-			   AMRWB_LIBS="-lopencore-amrwb")
-      ])
+  PKG_CHECK_MODULES(AMRWB, opencore-amrwb, [
+    if $PKG_CONFIG --atleast-version=0.1.3 opencore-amrwb; then
+      AC_DEFINE(HAVE_OPENCORE_AMRWB_0_1_3_OR_LATER, 1, [Defined for newer opencore-amrwb])
+    fi
+    HAVE_AMRWB="yes"
+  ], [
+    HAVE_AMRWB="no"
+  ])
   AC_SUBST(AMRWB_CFLAGS)
   AC_SUBST(AMRWB_LIBS)
 ])

diff --git a/ext/amrnb/amrnbdec.h b/ext/amrnb/amrnbdec.h
index 1e81839..5fe6982 100644
--- a/ext/amrnb/amrnbdec.h
+++ b/ext/amrnb/amrnbdec.h
@@ -22,7 +22,12 @@
 
 #include <gst/gst.h>
 #include <gst/audio/gstaudiodecoder.h>
+
+#ifdef HAVE_OPENCORE_AMRNB_0_1_3_OR_LATER
+#include <opencore-amrnb/interf_dec.h>
+#else
 #include <interf_dec.h>
+#endif
 
 G_BEGIN_DECLS
 
diff --git a/ext/amrnb/amrnbenc.h b/ext/amrnb/amrnbenc.h
index 7f673ac..48a8fe8 100644
--- a/ext/amrnb/amrnbenc.h
+++ b/ext/amrnb/amrnbenc.h
@@ -21,9 +21,14 @@
 #define __GST_AMRNBENC_H__
 
 #include <gst/gst.h>
-#include <interf_enc.h>
 #include <gst/audio/gstaudioencoder.h>
 
+#ifdef HAVE_OPENCORE_AMRNB_0_1_3_OR_LATER
+#include <opencore-amrnb/interf_enc.h>
+#else
+#include <interf_enc.h>
+#endif
+
 G_BEGIN_DECLS
 
 #define GST_TYPE_AMRNBENC \
diff --git a/ext/amrwbdec/amrwbdec.h b/ext/amrwbdec/amrwbdec.h
index c3528fc..6b82ae9 100644
--- a/ext/amrwbdec/amrwbdec.h
+++ b/ext/amrwbdec/amrwbdec.h
@@ -22,8 +22,14 @@
 
 #include <gst/gst.h>
 #include <gst/audio/gstaudiodecoder.h>
+
+#ifdef HAVE_OPENCORE_AMRWB_0_1_3_OR_LATER
+#include <opencore-amrwb/dec_if.h>
+#include <opencore-amrwb/if_rom.h>
+#else
 #include <dec_if.h>
 #include <if_rom.h>
+#endif
 
 G_BEGIN_DECLS
 
-- 
1.7.10