summaryrefslogtreecommitdiffstats
path: root/gst/rtpmanager/gstrtpssrcdemux.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2007-12-12 16:59:03 +0000
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2009-08-11 02:30:32 +0100
commita965ebff09d986440c340b3d609e45579fe74903 (patch)
tree47bff284acb56e31545aa16979b34815512470a6 /gst/rtpmanager/gstrtpssrcdemux.c
parentdf55cf2f087521bb55426669025ab45682aa9972 (diff)
gst/rtpmanager/: Clean up the dynamic pads when going to READY.
Original commit message from CVS: * gst/rtpmanager/gstrtpptdemux.c: (gst_rtp_pt_demux_finalize), (gst_rtp_pt_demux_setup), (gst_rtp_pt_demux_release), (gst_rtp_pt_demux_change_state): * gst/rtpmanager/gstrtpssrcdemux.c: (gst_rtp_ssrc_demux_reset), (gst_rtp_ssrc_demux_dispose), (gst_rtp_ssrc_demux_src_query), (gst_rtp_ssrc_demux_change_state): Clean up the dynamic pads when going to READY.
Diffstat (limited to 'gst/rtpmanager/gstrtpssrcdemux.c')
-rw-r--r--gst/rtpmanager/gstrtpssrcdemux.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/gst/rtpmanager/gstrtpssrcdemux.c b/gst/rtpmanager/gstrtpssrcdemux.c
index d8d03d25..170ede31 100644
--- a/gst/rtpmanager/gstrtpssrcdemux.c
+++ b/gst/rtpmanager/gstrtpssrcdemux.c
@@ -309,15 +309,32 @@ gst_rtp_ssrc_demux_init (GstRtpSsrcDemux * demux,
}
static void
+gst_rtp_ssrc_demux_reset (GstRtpSsrcDemux * demux)
+{
+ GSList *walk;
+
+ for (walk = demux->srcpads; walk; walk = g_slist_next (walk)) {
+ GstRtpSsrcDemuxPad *dpad = (GstRtpSsrcDemuxPad *) walk->data;
+
+ gst_pad_set_active (dpad->rtp_pad, FALSE);
+ gst_pad_set_active (dpad->rtcp_pad, FALSE);
+
+ gst_element_remove_pad (GST_ELEMENT_CAST (demux), dpad->rtp_pad);
+ gst_element_remove_pad (GST_ELEMENT_CAST (demux), dpad->rtcp_pad);
+ g_free (dpad);
+ }
+ g_slist_free (demux->srcpads);
+ demux->srcpads = NULL;
+}
+
+static void
gst_rtp_ssrc_demux_dispose (GObject * object)
{
GstRtpSsrcDemux *demux;
demux = GST_RTP_SSRC_DEMUX (object);
- g_slist_foreach (demux->srcpads, (GFunc) g_free, NULL);
- g_slist_free (demux->srcpads);
- demux->srcpads = NULL;
+ gst_rtp_ssrc_demux_reset (demux);
G_OBJECT_CLASS (parent_class)->dispose (object);
}
@@ -592,12 +609,6 @@ gst_rtp_ssrc_demux_src_query (GstPad * pad, GstQuery * query)
"latency for SSRC %08x, latency %" GST_TIME_FORMAT, demuxpad->ssrc,
GST_TIME_ARGS (demuxpad->first_ts));
-#if 0
- min_latency += demuxpad->first_ts;
- if (max_latency != -1)
- max_latency += demuxpad->first_ts;
-#endif
-
gst_query_set_latency (query, live, min_latency, max_latency);
}
break;
@@ -633,6 +644,8 @@ gst_rtp_ssrc_demux_change_state (GstElement * element,
switch (transition) {
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
case GST_STATE_CHANGE_PAUSED_TO_READY:
+ gst_rtp_ssrc_demux_reset (demux);
+ break;
case GST_STATE_CHANGE_READY_TO_NULL:
default:
break;