[rtspsrc] Returning TRUE in the select-stream signal does not check for other streams
Submitted by Julian Bouzas
Not sure if this is a bug or a feature but I will try to explain it as best as I can.
We have an RTSP source that has 2 streams: a video stream and a metadata stream. For some reason, the metadata stream from that source does not work properly and causes the rtspsrc element to not play the video stream, which I suppose it is the desired behavior.
However, since we do not care about that metadata stream, I was planning to use the
select-stream signal from rtspsrc to only select the video stream and so discard the metadata stream, but it does not work as I expect because the callback seems to be removed after returning TRUE for the first time.
In my case, the first stream that is checked is the video stream, so returning TRUE will also select the metadata stream because the signal handler will NOT be called again. However, if I return FALSE when checking the video stream, the signal handler will be called for the metadata stream:
Video -> signal handler is called and TRUE is returned
Metadata -> signal handler is not called but the stream is also selected
Video -> signal handler is called and I return FALSE
Metadata -> signal handler is called
Shouldn't the signal handler be always called regardless of the return value of the previous call? In my case, it is not possible to just select the video stream and ignore the metadata stream because of the order they are checked.
If I add a small hack into the gst_rtspsrc_setup_streams() function (from gst/rtsp/rtspsrc.c) to only select the video stream in the for loop, the rtspsrc element plays the video stream fine without any issues: