ngraziano / SharpRTSP

A RTSP handling library
Other
538 stars 180 forks source link

Rtsp sdp parsing not in order as RFC2327. #119

Closed Revan1985 closed 6 months ago

Revan1985 commented 6 months ago

Some cameras and NVRs returns an sdp with a wrong order (not for multiple line composed methods). I have changed the sdp reading, which will not read in a mandatory order, but with a while. This will ensure also older cameras can be readed (example from real camera in sdp.test5 file). some NVR from Hanwha, anyway, returns the sdp with wrong i= position (2nd line instead of 4th+ line). The mandatory check (for protocol, owner, session and media) will be in the end, not in the 'v', 'o', 's' or 'm' value reading.

ngraziano commented 6 months ago

I have make a modification from your code to handle bad SDP from camera. I have keep a method more strict.