# HG changeset patch # User rbultje # Date 1232772978 0 # Node ID f1d8951d6813a76d53c1e516a7f1f1f185e3daca # Parent 99d0dac3981379153a2697b37b70cc32c5b8ccfb Skip m= blocks in the SDP if the media type is unknown. This prevents subsequent a= lines from the m= block to be applied to the previous m= line, thus breaking otherwise functional RTP streams. See discussion in [PATCH] RTSP-MS 7/15: parse and allow unknown m= line codes" thread on mailinglist. diff -r 99d0dac39813 -r f1d8951d6813 rtsp.c --- a/rtsp.c Fri Jan 23 22:16:31 2009 +0000 +++ b/rtsp.c Sat Jan 24 04:56:18 2009 +0000 @@ -325,6 +325,7 @@ /* SDP only */ struct in_addr default_ip; int default_ttl; + int skip_media; ///< set if an unknown m= line occurs } SDPParseState; static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, @@ -345,6 +346,8 @@ #endif p = buf; + if (s1->skip_media && letter != 'm') + return; switch(letter) { case 'c': get_word(buf1, sizeof(buf1), &p); @@ -383,12 +386,14 @@ break; case 'm': /* new stream */ + s1->skip_media = 0; get_word(st_type, sizeof(st_type), &p); if (!strcmp(st_type, "audio")) { codec_type = CODEC_TYPE_AUDIO; } else if (!strcmp(st_type, "video")) { codec_type = CODEC_TYPE_VIDEO; } else { + s1->skip_media = 1; return; } rtsp_st = av_mallocz(sizeof(RTSPStream));