rtspsrc: Use fallback stream when getting invalid transport headers
When trying to connect to a stream where the server replies with invalid headers we get 'Server did not select transport' error and the stream is not played. This happens even if the video transport header is ok and audio transport is the only invalid header.
If the audio transport header parsing fails, it should try parsing the video transport header and show stream without audio if parsing of video header is fine. And also vice-versa.
The same stream with invalid audio transport header is tested and shown to be supported by several other media player such as VLC, where the stream will be shown without the audio track.
Ref. issue #787, where the audio transport header was invalid from server side:
0:00:00.997070000 7576 126F3378 LOG rtspsrc gstrtspsrc.c:9647:dump_key_value:<source> key: 'Transport', value: 'Transport: RTP/AVP;unicast;client_port=59576-59577;server_port=21438-21439;source=192.168.105.5;destination=192.168.5.1'
Quote @slomo comment:
The problem is that the server is sending
Transport: Transport: RTP/AVP...
, so sending an invalid Transport header that has the header name duplicated in the value. So a broken server here
The issue was solved by fixing the header from server side in this case, but it would be nice to have a fallback in case it should happen with other servers as well.