CVS Root: /cvs/gstreamer
Module: gst-plugins-bad
Changes by: wtay
Date: Wed Nov 26 2008 12:40:33 UTC
Log message:
* gst/rtpmanager/rtpsession.c: (obtain_source),
(rtp_session_create_source), (rtp_session_process_rtp),
(rtp_session_process_sr), (rtp_session_process_rr),
(rtp_session_process_sdes), (rtp_session_process_bye):
Make obtain_source return an aditional ref so that we don't lose our ref
to it when a session cleanup occurs when we are emiting a signal.
Emit the on_new_ssrc signal for the CSRC, not the SSRC.
Fixes #562319.
Modified files:
. : ChangeLog
gst/rtpmanager : rtpsession.c
Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ChangeLog.diff?r1=1.3749&r2=1.3750
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/gst/rtpmanager/rtpsession.c.diff?r1=1.39&r2=1.40
====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-bad/ChangeLog,v
retrieving revision 1.3749
retrieving revision 1.3750
diff -u -d -r1.3749 -r1.3750
--- ChangeLog 26 Nov 2008 12:02:20 -0000 1.3749
+++ ChangeLog 26 Nov 2008 12:40:17 -0000 1.3750
@@ -1,5 +1,16 @@
2008-11-26 Wim Taymans <[email protected]>
+ * gst/rtpmanager/rtpsession.c: (obtain_source),
+ (rtp_session_create_source), (rtp_session_process_rtp),
+ (rtp_session_process_sr), (rtp_session_process_rr),
+ (rtp_session_process_sdes), (rtp_session_process_bye):
+ Make obtain_source return an aditional ref so that we don't lose our ref
+ to it when a session cleanup occurs when we are emiting a signal.
+ Emit the on_new_ssrc signal for the CSRC, not the SSRC.
+ Fixes #562319.
+
+2008-11-26 Wim Taymans <[email protected]>
* gst/rtpmanager/gstrtpbin.c: (gst_rtp_bin_reset_sync),
(gst_rtp_bin_clear_pt_map):
Reset the sync parameters when clearing the payload type map too.
Index: rtpsession.c
RCS file: /cvs/gstreamer/gst-plugins-bad/gst/rtpmanager/rtpsession.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- rtpsession.c 22 Nov 2008 15:31:36 -0000 1.39
+++ rtpsession.c 26 Nov 2008 12:40:18 -0000 1.40
@@ -1107,7 +1107,8 @@
}
-/* must be called with the session lock */
+/* must be called with the session lock, the returned source needs to be
+ * unreffed after usage. */
static RTPSource *
obtain_source (RTPSession * sess, guint32 ssrc, gboolean * created,
RTPArrivalStats * arrival, gboolean rtp)
@@ -1156,6 +1157,7 @@
source->last_activity = arrival->time;
if (rtp)
source->last_rtp_activity = arrival->time;
+ g_object_ref (source);
return source;
@@ -1392,8 +1394,9 @@
RTP_SESSION_LOCK (sess);
ssrc = rtp_session_create_new_ssrc (sess);
source = rtp_source_new (ssrc);
- g_object_ref (source);
rtp_source_set_callbacks (source, &callbacks, sess);
+ /* we need an additional ref for the source in the hashtable */
g_hash_table_insert (sess->ssrcs[sess->mask_idx], GINT_TO_POINTER (ssrc),
source);
/* we have one more source now */
@@ -1477,7 +1480,6 @@
/* get SSRC and look up in session database */
ssrc = gst_rtp_buffer_get_ssrc (buffer);
source = obtain_source (sess, ssrc, &created, &arrival, TRUE);
-
if (!source)
goto collision;
@@ -1521,16 +1523,20 @@
/* get source */
csrc_src = obtain_source (sess, csrc, &created, &arrival, TRUE);
+ if (!csrc_src)
+ continue;
if (created) {
GST_DEBUG ("created new CSRC: %08x", csrc);
rtp_source_set_as_csrc (csrc_src);
if (RTP_SOURCE_IS_ACTIVE (csrc_src))
sess->stats.active_sources++;
- on_new_ssrc (sess, source);
+ on_new_ssrc (sess, csrc_src);
}
+ g_object_unref (csrc_src);
}
}
+ g_object_unref (source);
gst_buffer_unref (buffer);
RTP_SESSION_UNLOCK (sess);
@@ -1614,7 +1620,6 @@
senderssrc, GST_TIME_ARGS (arrival->time));
source = obtain_source (sess, senderssrc, &created, arrival, FALSE);
return;
@@ -1634,6 +1639,7 @@
on_new_ssrc (sess, source);
rtp_session_process_rb (sess, source, packet, arrival);
/* A receiver report contains statistics about how a receiver is doing. It
@@ -1655,7 +1661,6 @@
GST_DEBUG ("got RR packet: SSRC %08x", senderssrc);
@@ -1663,6 +1668,7 @@
/* Get SDES items and store them in the SSRC */
@@ -1687,10 +1693,10 @@
GST_DEBUG ("item %d, SSRC %08x", i, ssrc);
- /* find src, no probation when dealing with RTCP */
- source = obtain_source (sess, ssrc, &created, arrival, FALSE);
changed = FALSE;
+ /* find src, no probation when dealing with RTCP */
+ source = obtain_source (sess, ssrc, &created, arrival, FALSE);
if (!source)
return;
@@ -1719,6 +1725,8 @@
if (changed)
on_ssrc_sdes (sess, source);
+ g_object_unref (source);
more_items = gst_rtcp_packet_sdes_next_item (packet);
i++;
@@ -1748,7 +1756,6 @@
/* find src and mark bye, no probation when dealing with RTCP */
source = obtain_source (sess, ssrc, &created, arrival, FALSE);
@@ -1803,6 +1810,8 @@
on_new_ssrc (sess, source);
on_bye_ssrc (sess, source);
g_free (reason);
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.