GNOME Bugzilla – Bug 748585
opus: don't use deprecated gst_buffer_new_and_alloc()
Last modified: 2015-04-28 15:38:16 UTC
gst_opus_enc_encode() should use gst_audio_encoder_allocate_output_buffer() instead of the deprecated gst_buffer_new_and_alloc(). Similar change in the decoder. Diff: diff --git a/ext/opus/gstopusdec.c b/ext/opus/gstopusdec.c index d3c8e8d..a634787 100644 --- a/ext/opus/gstopusdec.c +++ b/ext/opus/gstopusdec.c @@ -431,7 +431,9 @@ opus_dec_chain_parse_data (GstOpusDec * dec, GstBuffer * buffer) samples = 120 * dec->sample_rate / 1000; packet_size = samples * dec->n_channels * 2; - outbuf = gst_buffer_new_and_alloc (packet_size); + outbuf = + gst_audio_decoder_allocate_output_buffer (GST_AUDIO_DECODER (dec), + packet_size); if (!outbuf) { goto buffer_failed; } diff --git a/ext/opus/gstopusenc.c b/ext/opus/gstopusenc.c index 0d6612b..5669920 100644 --- a/ext/opus/gstopusenc.c +++ b/ext/opus/gstopusenc.c @@ -918,7 +918,9 @@ gst_opus_enc_encode (GstOpusEnc * enc, GstBuffer * buf) g_assert (size == bytes); - outbuf = gst_buffer_new_and_alloc (max_payload_size * enc->n_channels); + outbuf = + gst_audio_encoder_allocate_output_buffer (GST_AUDIO_ENCODER (enc), + max_payload_size * enc->n_channels); if (!outbuf) goto done;
Could you make a proper patch in git format-patch format please? (With author set correctly and commit message)
Created attachment 302521 [details] [review] [PATCH 1/1] opus: don't use deprecated gst_buffer_new_and_alloc
Perfect, thanks! commit 036f07e087c7ff7c7920d0b958c7c31c49c8e793 Author: Mersad Jelacic <mersad@axis.com> Date: Tue Apr 28 16:58:21 2015 +0200 opus: don't use deprecated gst_buffer_new_and_alloc Use the helper function available in the base class instead. https://bugzilla.gnome.org/show_bug.cgi?id=748585