summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Crête <olivier.crete@collabora.com>2012-09-20 18:41:24 -0400
committerTim-Philipp Müller <tim@centricular.com>2016-02-17 14:58:00 +0000
commit18638c9c4e8e199caf399f53e79c7e4c0693bc80 (patch)
treef3482a4b5ac11228992c445bbabdc3e9a7c4e6d4
parentad261f64c39550545104c67824b704716cb9cb57 (diff)
downloadgstreamer-plugins-good-18638c9c4e8e199caf399f53e79c7e4c0693bc80.tar.gz
rtpopuspay: Allocate the rtp buffer correctly
Use the right functions to allocate the rtp buffer
-rw-r--r--gst/rtp/gstrtpopuspay.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/gst/rtp/gstrtpopuspay.c b/gst/rtp/gstrtpopuspay.c
index 9eee96066..e1781e1b0 100644
--- a/gst/rtp/gstrtpopuspay.c
+++ b/gst/rtp/gstrtpopuspay.c
@@ -112,24 +112,10 @@ static GstFlowReturn
gst_rtp_opus_pay_handle_buffer (GstRTPBasePayload * basepayload,
GstBuffer * buffer)
{
- GstRTPBuffer rtpbuf = { NULL, };
GstBuffer *outbuf;
- GstMapInfo map;
-
- /* Copy data and timestamp to a new output buffer
- * FIXME : Don't we have a convenience function for this ? */
- gst_buffer_map (buffer, &map, GST_MAP_READ);
- outbuf = gst_rtp_buffer_new_copy_data (map.data, map.size);
- GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buffer);
-
- /* Unmap and free input buffer */
- gst_buffer_unmap (buffer, &map);
- gst_buffer_unref (buffer);
-
- /* Remove marker from RTP buffer */
- gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtpbuf);
- gst_rtp_buffer_set_marker (&rtpbuf, FALSE);
- gst_rtp_buffer_unmap (&rtpbuf);
+
+ outbuf = gst_rtp_buffer_new_allocate (0, 0, 0);
+ outbuf = gst_buffer_append (outbuf, gst_buffer_ref (buffer));
/* Push out */
return gst_rtp_base_payload_push (basepayload, outbuf);