mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 12:32:29 +00:00
rtpptdemux: do no assume sink caps are non NULL
This commit is contained in:
parent
c8f442deb0
commit
359b0a86f1
1 changed files with 16 additions and 13 deletions
|
@ -325,23 +325,26 @@ gst_rtp_pt_demux_get_caps (GstRtpPtDemux * rtpdemux, guint pt)
|
|||
g_value_unset (&ret);
|
||||
|
||||
sink_caps = gst_pad_get_current_caps (rtpdemux->sink);
|
||||
if (caps == NULL) {
|
||||
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);
|
||||
if (sink_caps) {
|
||||
if (caps == NULL) {
|
||||
caps = gst_caps_ref (sink_caps);
|
||||
} else {
|
||||
GstStructure *s1;
|
||||
GstStructure *s2;
|
||||
guint ssrc;
|
||||
|
||||
gst_structure_get_uint (s1, "ssrc", &ssrc);
|
||||
gst_structure_set (s2, "ssrc", G_TYPE_UINT, ssrc, NULL);
|
||||
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_caps_unref (sink_caps);
|
||||
|
||||
GST_DEBUG ("pt %d, got caps %" GST_PTR_FORMAT, pt, caps);
|
||||
|
||||
return caps;
|
||||
|
|
Loading…
Reference in a new issue