summaryrefslogtreecommitdiff
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2009-01-09 23:36:17 +0000
committerRonald S. Bultje <rsbultje@gmail.com>2009-01-09 23:36:17 +0000
commit83d14c85da70963a73f40e818fbbe474deff44d2 (patch)
tree7dd7cf75764762d1bb0d6cf345e59295d14b7595 /libavformat/rtsp.c
parent7eb6ed78ea191c48279fc208f676807cfd3d732d (diff)
Apply rtpmap: SDP lines to the last m= line only, since they generally just
come directly after each m= line if required. See "[PATCH] RTSP-MS 5-6/15: parse only the last m= line stream per rtpmap line" thread on ML. Originally committed as revision 16509 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r--libavformat/rtsp.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 464cffe3bc..e4d3128556 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -441,17 +441,13 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
} else {
av_strlcpy(rtsp_st->control_url, p, sizeof(rtsp_st->control_url));
}
- } else if (av_strstart(p, "rtpmap:", &p)) {
+ } else if (av_strstart(p, "rtpmap:", &p) && s->nb_streams > 0) {
/* NOTE: rtpmap is only supported AFTER the 'm=' tag */
get_word(buf1, sizeof(buf1), &p);
payload_type = atoi(buf1);
- for(i = 0; i < s->nb_streams;i++) {
- st = s->streams[i];
+ st = s->streams[s->nb_streams - 1];
rtsp_st = st->priv_data;
- if (rtsp_st->sdp_payload_type == payload_type) {
sdp_parse_rtpmap(st->codec, rtsp_st, payload_type, p);
- }
- }
} else if (av_strstart(p, "fmtp:", &p)) {
/* NOTE: fmtp is only supported AFTER the 'a=rtpmap:xxx' tag */
get_word(buf1, sizeof(buf1), &p);