summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-02-29 19:37:15 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-02-29 19:37:15 +0000
commit93f2cfda49d36c29a089012fd7e9df0bcaa8682e (patch)
tree0821407fd2daab8f334993a373af60a08d344eb1 /audio
parent7a68b05beaed5944dcd88f23002c9f55a2f74ba6 (diff)
Remove possible extra memcpy for gstreamer plugin.
Diffstat (limited to 'audio')
-rw-r--r--audio/gstrtpsbcpay.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/audio/gstrtpsbcpay.c b/audio/gstrtpsbcpay.c
index 33640c43..d0fec58e 100644
--- a/audio/gstrtpsbcpay.c
+++ b/audio/gstrtpsbcpay.c
@@ -166,7 +166,6 @@ static GstFlowReturn gst_rtp_sbc_pay_flush_buffers(GstRtpSBCPay *sbcpay)
guint max_payload;
GstBuffer* outbuf;
guint8 *payload_data;
- guint8 *data;
guint frame_count;
guint payload_length;
struct rtp_payload *payload;
@@ -199,10 +198,9 @@ static GstFlowReturn gst_rtp_sbc_pay_flush_buffers(GstRtpSBCPay *sbcpay)
memset(payload, 0, sizeof(struct rtp_payload));
payload->frame_count = frame_count;
- data = gst_adapter_take(sbcpay->adapter, payload_length);
- memcpy(payload_data + RTP_SBC_PAYLOAD_HEADER_SIZE, data,
- payload_length);
- g_free(data);
+ gst_adapter_copy(sbcpay->adapter, payload_data +
+ RTP_SBC_PAYLOAD_HEADER_SIZE, 0, payload_length);
+ gst_adapter_flush(sbcpay->adapter, payload_length);
GST_BUFFER_TIMESTAMP(outbuf) = sbcpay->timestamp;
GST_DEBUG_OBJECT (sbcpay, "Pushing %d bytes", payload_length);