+/* returns a reference to the pad if found, %NULL otherwise */
+static GstPad *
+get_demux_pad_for_ssrc (GstRtpSsrcDemux * demux, guint32 ssrc, PadType padtype)
+{
+ GstRtpSsrcDemuxPad *demuxpad;
+ GstPad *retpad;
+
+ GST_OBJECT_LOCK (demux);
+
+ demuxpad = find_demux_pad_for_ssrc (demux, ssrc);
+ if (!demuxpad) {
+ GST_OBJECT_UNLOCK (demux);
+ return NULL;
+ }
+
+ switch (padtype) {
+ case RTP_PAD:
+ retpad = gst_object_ref (demuxpad->rtp_pad);
+ break;
+ case RTCP_PAD:
+ retpad = gst_object_ref (demuxpad->rtcp_pad);
+ break;
+ default:
+ retpad = NULL;
+ g_assert_not_reached ();
+ }
+
+ GST_OBJECT_UNLOCK (demux);
+
+ return retpad;
+}
+