From e154dfa2945f636ec8f89863dc80d1a7161db30a Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 13 Aug 2024 16:21:09 +0200 Subject: [PATCH] rxrx/sdp: print URL only once + when no autorun - 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 --- src/utils/sdp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/utils/sdp.c b/src/utils/sdp.c index 24d3a88a3..b01ea0227 100644 --- a/src/utils/sdp.c +++ b/src/utils/sdp.c @@ -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) { @@ -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)