GNOME Bugzilla – Bug 772478
Missing video stream from SDP
Last modified: 2016-10-31 14:34:01 UTC
I have an RTSP server streaming local files. Those files could have audio or video or both. I'm using "dynpay0" to add pads dynamically depending on what's on the file when I start it. Sometimes when playing a stream that should have both audio and video, the client receives an SDP that has only audio. My understanding (but I'm not sure yet) is that rtsp-media gets into pad_added_cb() code path then calls gst_rtsp_stream_join_bin(). That function will connect to "notify::caps" signal on priv->send_src[0]. But since the media is in PAUSED state already, caps could already be set on the pad and notify signal won't be emitted. In that case priv->caps stay to NULL. In that case gst_rtsp_sdp_from_stream() won't have the caps and thus will ignore that stream.
Created attachment 337077 [details] [review] stream: Fix randomly missing streams from SDP with dynamic elements When using dynamic elements, gst_rtsp_stream_join_bin() is called from "pad-added" signal. In that case priv->srcpad could already have its caps, and they'll be sent to priv->send_src[0] pad. That means that when it connects "notify::caps" signal, that pad could already have received its caps and the signal won't be emitted anymore. In that case priv->caps stay to NULL and when building the SDP that stream gets ignored. Leading to missing video or audio when playing in client side.
Comment on attachment 337077 [details] [review] stream: Fix randomly missing streams from SDP with dynamic elements Check if priv->caps is set already, and you need to lock here and in caps_notify callback.
(In reply to Sebastian Dröge (slomo) from comment #2) > Check if priv->caps is set already, and you need to lock here and in > caps_notify callback. It already has priv->lock and caps_notify gets it as well. priv->caps cannot be already set because only caps_notify() set it and it just connected the signal there.
Comment on attachment 337077 [details] [review] stream: Fix randomly missing streams from SDP with dynamic elements Does not apply to git master
Attachment 337077 [details] pushed as c0f24fe - stream: Fix randomly missing streams from SDP with dynamic elements
Comment on attachment 337077 [details] [review] stream: Fix randomly missing streams from SDP with dynamic elements It does when manually applying it with patch --merge