[FFmpeg-cvslog] avformat/rtsp: correctly set media control uri with mpegts

tpol git at videolan.org
Mon Jan 18 04:42:36 EET 2021

ffmpeg | branch: master | tpol <> | Sat Oct 10 19:22:18 2020 -0400| [71ce5c32f0bfcbe053bc9110923bbe7479c358e3] | committer: Andriy Gelman

avformat/rtsp: correctly set media control uri with mpegts

Fixes #1941

Currently the media control uri is not correctly assigned when mpegts is
signalled in the media description.

The code checks whether at least one AVStream has been setup before
assigning to the media's uri. With mpegts the AVStreams are setup when
parsing packets and so the media's uri is skipped. This is fixed by
using rt->nb_rtsp_streams in the check which counts all medias in the

Reviewed-by: Andriy Gelman <andriy.gelman at gmail.com>
Signed-off-by: Andriy Gelman <andriy.gelman at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=71ce5c32f0bfcbe053bc9110923bbe7479c358e3

 libavformat/rtsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index d1f5762f7c..1b24496f3c 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -571,7 +571,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
     case 'a':
         if (av_strstart(p, "control:", &p)) {
-            if (s->nb_streams == 0) {
+            if (rt->nb_rtsp_streams == 0) {
                 if (!strncmp(p, "rtsp://", 7))
                     av_strlcpy(rt->control_uri, p,

More information about the ffmpeg-cvslog mailing list