rtpsession: Make rtcp buffer metadata writable after processing it

Functions that process the rtcp buffer could decide to keep a ref
on the buffer for further processing. So make the metadata writable
only after they are done.
This commit is contained in:
Olivier Crête 2010-09-07 13:35:16 +03:00 committed by Wim Taymans
parent 1643f427db
commit 90354ecb49

View file

@ -2048,9 +2048,6 @@ rtp_session_process_rtcp (RTPSession * sess, GstBuffer * buffer,
if (sess->sent_bye) if (sess->sent_bye)
goto ignore; goto ignore;
/* make writable, we might want to change the buffer */
buffer = gst_buffer_make_metadata_writable (buffer);
/* start processing the compound packet */ /* start processing the compound packet */
more = gst_rtcp_buffer_get_first_packet (buffer, &packet); more = gst_rtcp_buffer_get_first_packet (buffer, &packet);
while (more) { while (more) {
@ -2111,10 +2108,13 @@ rtp_session_process_rtcp (RTPSession * sess, GstBuffer * buffer,
RTP_SESSION_UNLOCK (sess); RTP_SESSION_UNLOCK (sess);
/* notify caller of sr packets in the callback */ /* notify caller of sr packets in the callback */
if (do_sync && sess->callbacks.sync_rtcp) if (do_sync && sess->callbacks.sync_rtcp) {
/* make writable, we might want to change the buffer */
buffer = gst_buffer_make_metadata_writable (buffer);
result = sess->callbacks.sync_rtcp (sess, sess->source, buffer, result = sess->callbacks.sync_rtcp (sess, sess->source, buffer,
sess->sync_rtcp_user_data); sess->sync_rtcp_user_data);
else } else
gst_buffer_unref (buffer); gst_buffer_unref (buffer);
return result; return result;