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) {
}
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);
}