diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 842503b620..ff66f4bb44 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -605,14 +605,16 @@ static void rtsp_parse_transport(RTSPHeader *reply, const char *p) if (*p == '/') p++; if (!strcasecmp (transport_protocol, "rtp")) { - get_word_sep(profile, sizeof(profile), "/;,", &p); - lower_transport[0] = '\0'; - if (*p == '/') { /* rtp/avp/ */ - p++; - get_word_sep(lower_transport, sizeof(lower_transport), - ";,", &p); - } - } else if (!strcasecmp (transport_protocol, "x-pn-tng")) { /* x-pn-tng/ */ + get_word_sep(profile, sizeof(profile), "/;,", &p); + lower_transport[0] = '\0'; + /* rtp/avp/ */ + if (*p == '/') { + p++; + get_word_sep(lower_transport, sizeof(lower_transport), + ";,", &p); + } + } else if (!strcasecmp (transport_protocol, "x-pn-tng")) { + /* x-pn-tng/ */ get_word_sep(lower_transport, sizeof(lower_transport), "/;,", &p); profile[0] = '\0'; }