X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/d51722011c4a1b3223ae65d67cc5a01ebe6b519a..dc24572f945d226d486c138ecf20102ceec4eb35:/lib/uaudio-rtp.c diff --git a/lib/uaudio-rtp.c b/lib/uaudio-rtp.c index 7451136..ff7e839 100644 --- a/lib/uaudio-rtp.c +++ b/lib/uaudio-rtp.c @@ -55,10 +55,12 @@ static int rtp_payload; /** @brief RTP output socket */ -static int rtp_fd; +static int rtp_fd = -1; /** @brief RTP output socket (IPv6) */ static int rtp_fd6; +/** @brief RTP unicast output socket (IPv6) */ +static int rtp_fd6 = -1; /** @brief RTP SSRC */ static uint32_t rtp_id; @@ -389,6 +391,7 @@ static void rtp_open(void) { } /* Enlarge the socket buffers */ hack_send_buffer_size(rtp_fd, "master socket"); + hack_send_buffer_size(rtp_fd6, "IPv6 on-demand socket"); /* We might well want to set additional broadcast- or multicast-related * options here */ if(rtp_mode != RTP_REQUEST) { @@ -446,12 +449,8 @@ static void rtp_start(uaudio_callback *callback, static void rtp_stop(void) { uaudio_thread_stop(); - close(rtp_fd); - rtp_fd = -1; - if(rtp_fd6 >= 0) { - close(rtp_fd6); - rtp_fd6 = -1; - } + close(rtp_fd); rtp_fd = -1; + if(rtp_fd6 >= 0) { close(rtp_fd6); rtp_fd6 = -1; } } static void rtp_configure(void) {