lib/uaudio-rtp.c: Fix initial values for socket descriptors.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 4 May 2020 18:26:42 +0000 (19:26 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 5 May 2020 22:18:28 +0000 (23:18 +0100)
The code in `rtp_stop' checks for the sentinel value -1 when trying to
close sockets.  Without this, it might get (and then ignore!) a spurious
`EBADF' when shutting down.

lib/uaudio-rtp.c

index 7451136..2efd910 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;