[asterisk-scf-commits] asterisk-scf/integration/media_rtp_pjmedia.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Aug 18 09:35:44 CDT 2010


branch "master" has been updated
       via  6ddd3b98d2459117271ba2b060068f7b00b61eb8 (commit)
      from  025ec1c1d97657a483ee73448054e3d2ed2f96eb (commit)

Summary of changes:
 src/RTPSource.cpp |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)


- Log -----------------------------------------------------------------
commit 6ddd3b98d2459117271ba2b060068f7b00b61eb8
Author: Joshua Colp <jcolp at digium.com>
Date:   Wed Aug 18 11:48:02 2010 -0300

    Make the payload copying a bit more sane thanks to Ken.

diff --git a/src/RTPSource.cpp b/src/RTPSource.cpp
index 6e98cbc..8c371c1 100644
--- a/src/RTPSource.cpp
+++ b/src/RTPSource.cpp
@@ -149,10 +149,10 @@ static void receiveRTP(void *userdata, void *packet, pj_ssize_t size)
 	}
 
 	const pjmedia_rtp_hdr* header;
-	const void* payload;
+	Ice::Byte* payload;
 	unsigned int payload_size;
 
-	pj_status_t status = pjmedia_rtp_decode_rtp(&source->mImpl->mIncomingSession, packet, size, &header, &payload, &payload_size);
+	pj_status_t status = pjmedia_rtp_decode_rtp(&source->mImpl->mIncomingSession, packet, size, &header, (const void**)&payload, &payload_size);
 
 	if (status != PJ_SUCCESS)
 	{
@@ -175,11 +175,8 @@ static void receiveRTP(void *userdata, void *packet, pj_ssize_t size)
 		frame->timestamp = header->ts;
 		frame->seqno = header->seq;
 
-		/* Yay! The actual payload! */
-		frame->payload.resize(payload_size);
-
-		/* TODO: Use vectorness to do this instead of memcpy if possible */
-		memcpy(&frame->payload[0], payload, payload_size);
+		/* Copy the payload from the RTP packet to the frame, yahoo! */
+		copy(payload, payload + payload_size, std::back_inserter(frame->payload));
 
 		/* Into the sequence it goes, yarrrrrrrrrr matey */
 		frames.push_back(frame);

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/media_rtp_pjmedia.git



More information about the asterisk-scf-commits mailing list