rtsp-media: Get rates only on sender streams

When play a media with both sender and receiver stream, like ONVIF
back channel audio in, gst_rtsp_media_get_rates call
gst_rtsp_stream_get_rates for each stream to set the rates. But
gst_rtsp_stream_get_rates return false for the receiver steam, which
lead a g_assert crash.

Instead to get rates on all streams, now just get rates on sender
streams.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/-/merge_requests/150>
This commit is contained in:
Guiqin Zou 2020-09-11 15:46:41 +02:00 committed by GStreamer Merge Bot
parent 3b9eaa092e
commit c747711ac5

View file

@ -2709,7 +2709,8 @@ gst_rtsp_media_get_rates (GstRTSPMedia * media, gdouble * rate,
g_assert (priv->streams->len > 0);
for (i = 0; i < priv->streams->len; i++) {
stream = g_ptr_array_index (priv->streams, i);
if (gst_rtsp_stream_is_complete (stream)) {
if (gst_rtsp_stream_is_complete (stream)
&& gst_rtsp_stream_is_sender (stream)) {
if (gst_rtsp_stream_get_rates (stream, rate, applied_rate)) {
if (first_stream) {
save_rate = *rate;