mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
rtsp: Parse and use the Content-Base reply header, if present
This fixes playing RTSP urls with query parameters. Originally committed as revision 25755 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
f3d77632d7
commit
dd22cfb101
@ -706,6 +706,9 @@ void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf,
|
|||||||
} else if (av_stristart(p, "Authentication-Info:", &p) && auth_state) {
|
} else if (av_stristart(p, "Authentication-Info:", &p) && auth_state) {
|
||||||
p += strspn(p, SPACE_CHARS);
|
p += strspn(p, SPACE_CHARS);
|
||||||
ff_http_auth_handle_header(auth_state, "Authentication-Info", p);
|
ff_http_auth_handle_header(auth_state, "Authentication-Info", p);
|
||||||
|
} else if (av_stristart(p, "Content-Base:", &p)) {
|
||||||
|
p += strspn(p, SPACE_CHARS);
|
||||||
|
av_strlcpy(reply->content_base, p , sizeof(reply->content_base));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,6 +165,10 @@ typedef struct RTSPMessageHeader {
|
|||||||
* returned
|
* returned
|
||||||
*/
|
*/
|
||||||
char reason[256];
|
char reason[256];
|
||||||
|
|
||||||
|
/** The "Content-Base:" field.
|
||||||
|
*/
|
||||||
|
char content_base[4096];
|
||||||
} RTSPMessageHeader;
|
} RTSPMessageHeader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -105,6 +105,9 @@ int ff_rtsp_setup_input_streams(AVFormatContext *s, RTSPMessageHeader *reply)
|
|||||||
av_freep(&content);
|
av_freep(&content);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
if (reply->content_base[0])
|
||||||
|
av_strlcpy(rt->control_uri, reply->content_base,
|
||||||
|
sizeof(rt->control_uri));
|
||||||
|
|
||||||
av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", content);
|
av_log(s, AV_LOG_VERBOSE, "SDP:\n%s\n", content);
|
||||||
/* now we got the SDP description, we parse it */
|
/* now we got the SDP description, we parse it */
|
||||||
|
Loading…
Reference in New Issue
Block a user