From 90354ecb49096408ba6e21b9e050f4c61c9ddcb0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Tue, 7 Sep 2010 13:35:16 +0300 Subject: [PATCH] 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. --- gst/rtpmanager/rtpsession.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c index d4bbf08..5938d55 100644 --- a/gst/rtpmanager/rtpsession.c +++ b/gst/rtpmanager/rtpsession.c @@ -2048,9 +2048,6 @@ rtp_session_process_rtcp (RTPSession * sess, GstBuffer * buffer, if (sess->sent_bye) goto ignore; - /* make writable, we might want to change the buffer */ - buffer = gst_buffer_make_metadata_writable (buffer); - /* start processing the compound packet */ more = gst_rtcp_buffer_get_first_packet (buffer, &packet); while (more) { @@ -2111,10 +2108,13 @@ rtp_session_process_rtcp (RTPSession * sess, GstBuffer * buffer, RTP_SESSION_UNLOCK (sess); /* 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, sess->sync_rtcp_user_data); - else + } else gst_buffer_unref (buffer); return result; -- 2.7.4