Broken RTSP URI handling in GStreamer 1.22+
Describe your issue
I have custom RTSP server. Until recently it used to support sessions with single stream only. In DESCRIBE SDP server sent the same absolute URI at both session and media levels and it worked with all GStreamer versions. Recently server was changed to support multiple streams per session so it appends extra suffix to media control URL and GStreamer 1.22+ stopped working correctly (checked versions: 1.20.3 works fine, 1.22.11 and 1.24.1 are broken). URIs contains parameters after question mark, what may be important here. Protocol is https.
Now server sends following line for session control URI:
a=control:rtsps://domain.com/path?args
This is for media control URI:
a=control:rtsps://domain.com/path/video?args
I saw following incorrect behaviors:
- sometimes URI in SETUP is ok (at least my server does not complain), but PLAY uses media URI instead of session one: PLAY rtsps://domain.com/path/video?args RTSP/1.0
- sometimes SETUP is sent with concatenated session and media URIs: SETUP rtsps://domain.com/path?args/rtsps://domain.com/path/video?args RTSP/1.0
- sometimes URI in SETUP is ok, but PLAY is sent on concatenated URIs: PLAY rtsps://domain.com/path?args/rtsps://domain.com/path/video?args RTSP/1.0
It seems that actual behavior depends on URI length - concatenation happen for longer URIs with more parameters.
Expected Behavior
GStreamer uses absolute URIs as-is (no concatenation). PLAY is sent on session URI.
Observed Behavior
Incorrect URI used, as described above
Setup
- Operating System: Linux Ubuntu 22.04 LTS
- Device: Virtual Machine
- GStreamer Version: 1.22.11, 1.24.1
- Command line: not sure as I saw this in server logs.