[Bug 748585] New: Opus uses deprecated function gst_buffer_new_and_alloc

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Tue Apr 28 07:03:06 PDT 2015


https://bugzilla.gnome.org/show_bug.cgi?id=748585

            Bug ID: 748585
           Summary: Opus uses deprecated function gst_buffer_new_and_alloc
    Classification: Platform
           Product: GStreamer
           Version: git master
                OS: All
            Status: NEW
          Severity: major
          Priority: Normal
         Component: gst-plugins-bad
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: mersad at axis.com
        QA Contact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---

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;

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list