chiark / gitweb /
lib/uaudio-rtp.c: Set the send buffer for the IPv6 on-demand socket.
[disorder] / lib / uaudio-rtp.c
index 745113604ffe41a5e61945b24120ed21591b2946..ff7e839c30982081d0db5fe67d5a5ae36390cc12 100644 (file)
 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) {