summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuiqin Zou <guiqinzu@axis.com>2020-09-11 15:46:41 +0200
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-09-18 07:02:12 +0000
commitc747711ac5562e53f90ed96e87776a2e6b9806ba (patch)
treeac2d78df58e533bd7f66098946c2eec6fa4900d8
parent3b9eaa092e74da2c63fe6a98f5942bf100511dde (diff)
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>
-rw-r--r--gst/rtsp-server/rtsp-media.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c
index 8159697..7a7a2f1 100644
--- a/gst/rtsp-server/rtsp-media.c
+++ b/gst/rtsp-server/rtsp-media.c
@@ -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;