summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
Diffstat (limited to 'gst')
-rw-r--r--gst/rtpmanager/gstrtpptdemux.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/gst/rtpmanager/gstrtpptdemux.c b/gst/rtpmanager/gstrtpptdemux.c
index 9020a4412..f7d1e687b 100644
--- a/gst/rtpmanager/gstrtpptdemux.c
+++ b/gst/rtpmanager/gstrtpptdemux.c
@@ -250,6 +250,7 @@ gst_rtp_pt_demux_get_caps (GstRtpPtDemux * rtpdemux, guint pt)
GstCaps *caps;
GValue ret = { 0 };
GValue args[2] = { {0}, {0} };
+ GstCaps *sink_caps;
/* figure out the caps */
g_value_init (&args[0], GST_TYPE_ELEMENT);
@@ -267,10 +268,25 @@ gst_rtp_pt_demux_get_caps (GstRtpPtDemux * rtpdemux, guint pt)
g_value_unset (&args[1]);
caps = g_value_dup_boxed (&ret);
g_value_unset (&ret);
+
+ sink_caps = gst_pad_get_current_caps (rtpdemux->sink);
if (caps == NULL) {
- caps = gst_pad_get_current_caps (rtpdemux->sink);
+ caps = gst_caps_ref (sink_caps);
+ } else {
+ GstStructure *s1;
+ GstStructure *s2;
+ guint ssrc;
+
+ caps = gst_caps_make_writable (caps);
+ s1 = gst_caps_get_structure (sink_caps, 0);
+ s2 = gst_caps_get_structure (caps, 0);
+
+ gst_structure_get_uint (s1, "ssrc", &ssrc);
+ gst_structure_set (s2, "ssrc", G_TYPE_UINT, ssrc, NULL);
}
+ gst_caps_unref (sink_caps);
+
GST_DEBUG ("pt %d, got caps %" GST_PTR_FORMAT, pt, caps);
return caps;