mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-21 07:46:38 +00:00
parent
01dae19624
commit
3018802bda
2 changed files with 20 additions and 2 deletions
|
@ -518,7 +518,11 @@ celt_dec_chain_parse_header (GstCeltDec * dec, GstBuffer * buf)
|
|||
if (!dec->state)
|
||||
goto init_failed;
|
||||
|
||||
#ifdef HAVE_CELT_0_8
|
||||
dec->frame_size = dec->header.frame_size;
|
||||
#else
|
||||
celt_mode_info (dec->mode, CELT_GET_FRAME_SIZE, &dec->frame_size);
|
||||
#endif
|
||||
|
||||
dec->frame_duration = gst_util_uint64_scale_int (dec->frame_size,
|
||||
GST_SECOND, dec->header.sample_rate);
|
||||
|
@ -672,7 +676,11 @@ celt_dec_chain_parse_data (GstCeltDec * dec, GstBuffer * buf,
|
|||
|
||||
GST_LOG_OBJECT (dec, "decoding frame");
|
||||
|
||||
#ifdef HAVE_CELT_0_8
|
||||
error = celt_decode (dec->state, data, size, out_data, dec->frame_size);
|
||||
#else
|
||||
error = celt_decode (dec->state, data, size, out_data);
|
||||
#endif
|
||||
if (error != CELT_OK) {
|
||||
GST_WARNING_OBJECT (dec, "Decoding error: %d", error);
|
||||
return GST_FLOW_ERROR;
|
||||
|
|
|
@ -594,8 +594,6 @@ gst_celt_enc_setup (GstCeltEnc * enc)
|
|||
if (!enc->mode)
|
||||
goto mode_initialization_failed;
|
||||
|
||||
celt_mode_info (enc->mode, CELT_GET_FRAME_SIZE, &enc->frame_size);
|
||||
|
||||
#ifdef HAVE_CELT_0_7
|
||||
celt_header_init (&enc->header, enc->mode, enc->channels);
|
||||
#else
|
||||
|
@ -603,6 +601,12 @@ gst_celt_enc_setup (GstCeltEnc * enc)
|
|||
#endif
|
||||
enc->header.nb_channels = enc->channels;
|
||||
|
||||
#ifdef HAVE_CELT_0_8
|
||||
enc->frame_size = enc->header.frame_size;
|
||||
#else
|
||||
celt_mode_info (enc->mode, CELT_GET_FRAME_SIZE, &enc->frame_size);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CELT_0_7
|
||||
enc->state = celt_encoder_create (enc->mode, enc->channels, &error);
|
||||
#else
|
||||
|
@ -789,6 +793,11 @@ gst_celt_enc_encode (GstCeltEnc * enc, gboolean flush)
|
|||
|
||||
GST_DEBUG_OBJECT (enc, "encoding %d samples (%d bytes)", frame_size, bytes);
|
||||
|
||||
#ifdef HAVE_CELT_0_8
|
||||
outsize =
|
||||
celt_encode (enc->state, data, frame_size,
|
||||
GST_BUFFER_DATA (outbuf), bytes_per_packet);
|
||||
#else
|
||||
#ifdef HAVE_CELT_0_5
|
||||
outsize =
|
||||
celt_encode (enc->state, data, NULL,
|
||||
|
@ -797,6 +806,7 @@ gst_celt_enc_encode (GstCeltEnc * enc, gboolean flush)
|
|||
outsize =
|
||||
celt_encode (enc->state, data,
|
||||
GST_BUFFER_DATA (outbuf), bytes_per_packet);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
g_free (data);
|
||||
|
|
Loading…
Reference in a new issue