After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 748585 - opus: don't use deprecated gst_buffer_new_and_alloc()
opus: don't use deprecated gst_buffer_new_and_alloc()
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal minor
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-28 14:03 UTC by mersad
Modified: 2015-04-28 15:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH 1/1] opus: don't use deprecated gst_buffer_new_and_alloc (1.45 KB, patch)
2015-04-28 15:12 UTC, mersad
committed Details | Review

Description mersad 2015-04-28 14:03:06 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;
Comment 1 Tim-Philipp Müller 2015-04-28 14:38:58 UTC
Could you make a proper patch in git format-patch format please? (With author set correctly and commit message)
Comment 2 mersad 2015-04-28 15:12:48 UTC
Created attachment 302521 [details] [review]
[PATCH 1/1] opus: don't use deprecated gst_buffer_new_and_alloc
Comment 3 Tim-Philipp Müller 2015-04-28 15:37:59 UTC
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