From 1eb3f7f41fdbef005a62b3f03fdfd373f93c83ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 2 Mar 2011 23:43:42 +0100 Subject: [PATCH] celtenc: Fix compilation with celt >= 0.11.0 Fixes bug #643607. --- configure.ac | 7 +++++++ ext/celt/gstceltdec.c | 5 +++++ ext/celt/gstceltenc.c | 8 ++++++++ 3 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index a2a38bcf8f..374c7aaa83 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 1b3f4eb613..66c829e4b6 100644 --- a/ext/celt/gstceltdec.c +++ b/ext/celt/gstceltdec.c @@ -510,10 +510,15 @@ 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 4fd9ee8d93..74815798e1 100644 --- a/ext/celt/gstceltenc.c +++ b/ext/celt/gstceltenc.c @@ -629,10 +629,14 @@ 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; @@ -642,10 +646,14 @@ 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;