gstreamer-plugins-bad-free/gst-plugins-bad-fix-compilation-with-celt.patch

85 lines
2.4 KiB
Diff
Raw Normal View History

From 1eb3f7f41fdbef005a62b3f03fdfd373f93c83ed Mon Sep 17 00:00:00 2001
From: Sebastian Dröge <sebastian.droege@collabora.co.uk>
Date: Wed, 02 Mar 2011 22:43:42 +0000
Subject: celtenc: Fix compilation with celt >= 0.11.0
Fixes bug #643607.
---
diff --git a/configure.ac b/configure.ac
index a2a38bc..374c7aa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -639,6 +639,13 @@ AG_GST_CHECK_FEATURE(CELT, [celt], celt, [
dnl to prevent an error
true
])
+
+ PKG_CHECK_MODULES(CELT_0_11, celt >= 0.11.0, [
+ AC_DEFINE([HAVE_CELT_0_11], 1, [Define if libcelt 0.11 is installed])
+ ], [
+ dnl to prevent an error
+ true
+ ])
AC_SUBST(CELT_CFLAGS)
AC_SUBST(CELT_LIBS)
])
diff --git a/ext/celt/gstceltdec.c b/ext/celt/gstceltdec.c
index 1b3f4eb..66c829e 100644
--- a/ext/celt/gstceltdec.c
+++ b/ext/celt/gstceltdec.c
@@ -510,11 +510,16 @@ celt_dec_chain_parse_header (GstCeltDec * dec, GstBuffer * buf)
goto mode_init_failed;
/* initialize the decoder */
+#ifdef HAVE_CELT_0_11
+ dec->state =
+ celt_decoder_create_custom (dec->mode, dec->header.nb_channels, &error);
+#else
#ifdef HAVE_CELT_0_7
dec->state = celt_decoder_create (dec->mode, dec->header.nb_channels, &error);
#else
dec->state = celt_decoder_create (dec->mode);
#endif
+#endif
if (!dec->state)
goto init_failed;
diff --git a/ext/celt/gstceltenc.c b/ext/celt/gstceltenc.c
index 4fd9ee8..7481579 100644
--- a/ext/celt/gstceltenc.c
+++ b/ext/celt/gstceltenc.c
@@ -629,11 +629,15 @@ gst_celt_enc_setup (GstCeltEnc * enc)
if (!enc->mode)
goto mode_initialization_failed;
+#ifdef HAVE_CELT_0_11
+ celt_header_init (&enc->header, enc->mode, enc->frame_size, enc->channels);
+#else
#ifdef HAVE_CELT_0_7
celt_header_init (&enc->header, enc->mode, enc->channels);
#else
celt_header_init (&enc->header, enc->mode);
#endif
+#endif
enc->header.nb_channels = enc->channels;
#ifdef HAVE_CELT_0_8
@@ -642,11 +646,15 @@ gst_celt_enc_setup (GstCeltEnc * enc)
celt_mode_info (enc->mode, CELT_GET_FRAME_SIZE, &enc->frame_size);
#endif
+#ifdef HAVE_CELT_0_11
+ enc->state = celt_encoder_create_custom (enc->mode, enc->channels, &error);
+#else
#ifdef HAVE_CELT_0_7
enc->state = celt_encoder_create (enc->mode, enc->channels, &error);
#else
enc->state = celt_encoder_create (enc->mode);
#endif
+#endif
if (!enc->state)
goto encoder_creation_failed;
--
cgit v0.8.3-6-g21f6