1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-15 11:28:55 +02:00

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
sdp.

Reviewed-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
This commit is contained in:
tpol 2020-10-10 19:22:18 -04:00 committed by Andriy Gelman
parent 41ddb27597
commit 71ce5c32f0

View File

@ -571,7 +571,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
break;
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,
sizeof(rt->control_uri));