celtenc: Fix compilation with celt >= 0.11.0

Fixes bug #643607.
This commit is contained in:
Sebastian Dröge 2011-03-02 23:43:42 +01:00
parent 14fb720149
commit 1eb3f7f41f
3 changed files with 20 additions and 0 deletions

View file

@ -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)
])

View file

@ -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;

View file

@ -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;