RTSP client: handle also different RTSP port than 554
This commit is contained in:
parent
1c9b527011
commit
cbf1b15d00
1 changed files with 9 additions and 2 deletions
11
src/rtsp.c
11
src/rtsp.c
|
@ -33,8 +33,11 @@ rtsp_send( http_client_t *hc, http_cmd_t cmd,
|
|||
http_arg_list_t *hdr )
|
||||
{
|
||||
http_arg_list_t h;
|
||||
size_t blen = 7 + strlen(hc->hc_host) + (path ? strlen(path) : 1) + 1;
|
||||
size_t blen = 7 + strlen(hc->hc_host) +
|
||||
(hc->hc_port != 554 ? 7 : 0) +
|
||||
(path ? strlen(path) : 1) + 1;
|
||||
char *buf = alloca(blen);
|
||||
char buf2[7];
|
||||
|
||||
if (hc->hc_rtsp_session) {
|
||||
if (hdr == NULL) {
|
||||
|
@ -43,7 +46,11 @@ rtsp_send( http_client_t *hc, http_cmd_t cmd,
|
|||
}
|
||||
http_arg_set(hdr, "Session", hc->hc_rtsp_session);
|
||||
}
|
||||
snprintf(buf, blen, "rtsp://%s%s", hc->hc_host, path ? path : "/");
|
||||
if (hc->hc_port != 554)
|
||||
snprintf(buf2, sizeof(buf2), ":%d", hc->hc_port);
|
||||
else
|
||||
buf2[0] = '\0';
|
||||
snprintf(buf, blen, "rtsp://%s%s%s", hc->hc_host, buf2, path ? path : "/");
|
||||
return http_client_send(hc, cmd, buf, query, hdr, NULL, 0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue