shithub: opus-tools

Download patch

ref: 97a5c5faf362727051b1c5eeb683fbc69893179c
parent: d2ca877ff7dc38401b3c477208d322f25c18eb8d
author: Ralph Giles <[email protected]>
date: Mon Nov 5 09:12:45 EST 2012

Conditionalize the opusrtp socket code.

This lets it compile (but not be functional) on Windows,
which doesn't support the posix socket api.

--- a/src/opusrtp.c
+++ b/src/opusrtp.c
@@ -49,11 +49,13 @@
 #include <unistd.h>
 #include <getopt.h>
 
+#ifndef _WIN32
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <errno.h>
+#endif
 
 #ifdef HAVE_PCAP
 #include <pcap.h>
@@ -491,6 +493,7 @@
   return 0;
 }
 
+#ifndef _WIN32
 int send_rtp_packet(int fd, struct sockaddr *sin,
     rtp_header *rtp, const unsigned char *opus)
 {
@@ -637,6 +640,14 @@
   fclose(in);
   return 0;
 }
+#else /* _WIN32 */
+int rtp_send_file(const char *filename)
+{
+  fprintf(stderr, "Cannot send '%s'. Socket support not available.\n",
+      filename);
+  return -2;
+}
+#endif
 
 
 #ifdef HAVE_PCAP