Skip to content

Commit

Permalink
rxrx/sdp: print URL only once + when no autorun
Browse files Browse the repository at this point in the history
- print the direct RTP stream URLs only once (== do not repeat with
every printed address)
- print only if autorun was not specifiec
- take the IP version from the state
  • Loading branch information
MartinPulec committed Aug 14, 2024
1 parent 92ab653 commit 47749b7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/utils/sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,8 @@ static THREAD_RETURN_TYPE STDCALL_ON_WIN32 acceptConnectionsThread(void* param)
* the SDP (using static packet type)
*/
static void
print_std_rtp_urls(struct sdp *sdp, bool ipv6) {
const char *const bind_addr = ipv6 ? "[::]" : "0.0.0.0";
print_std_rtp_urls(struct sdp *sdp) {
const char *const bind_addr = sdp->ip_version == 6 ? "[::]" : "0.0.0.0";
int port = 0;
int pt = 0;
if (sdp->audio_index >= 0) {
Expand Down Expand Up @@ -540,10 +540,12 @@ static void print_http_path(struct sdp *sdp) {
"http://%s%s%s:%u/%s\n",
recv_str, ipv6 ? "[" : "", hostname, ipv6 ? "]" : "",
portInHostOrder, SDP_FILE);
print_std_rtp_urls(sdp, ipv6);
}
}
}
if (!autorun) {
print_std_rtp_urls(sdp);
}
}

static bool sdp_run_http_server(struct sdp *sdp, int port)
Expand Down

0 comments on commit 47749b7

Please sign in to comment.