[pulseaudio-commits] r1096 - in /trunk: configure.ac src/modules/rtp/module-rtp-recv.c src/modules/rtp/sap.c src/modules/rtp/sdp.c src/utils/padsp.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sun Jul 16 16:20:28 PDT 2006


Author: lennart
Date: Mon Jul 17 01:20:27 2006
New Revision: 1096

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1096&root=pulseaudio&view=rev
Log:
make pulseaudio compile again on FreeBSD (patch from Diego "Flameeyes" Petteno)

Modified:
    trunk/configure.ac
    trunk/src/modules/rtp/module-rtp-recv.c
    trunk/src/modules/rtp/sap.c
    trunk/src/modules/rtp/sdp.c
    trunk/src/utils/padsp.c

Modified: trunk/configure.ac
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/configure.ac?rev=1096&root=pulseaudio&r1=1095&r2=1096&view=diff
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Mon Jul 17 01:20:27 2006
@@ -248,6 +248,9 @@
 #### Large File-Support (LFS) ####
 
 AC_SYS_LARGEFILE
+
+# Check for open64 to know if the current system does have open64() and similar functions
+AC_CHECK_FUNCS([open64])
 
 #### [lib]iconv ####
 

Modified: trunk/src/modules/rtp/module-rtp-recv.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/rtp/module-rtp-recv.c?rev=1096&root=pulseaudio&r1=1095&r2=1096&view=diff
==============================================================================
--- trunk/src/modules/rtp/module-rtp-recv.c (original)
+++ trunk/src/modules/rtp/module-rtp-recv.c Mon Jul 17 01:20:27 2006
@@ -236,7 +236,7 @@
         struct ipv6_mreq mr6;
         memset(&mr6, 0, sizeof(mr6));
         mr6.ipv6mr_multiaddr = ((const struct sockaddr_in6*) sa)->sin6_addr;
-        r = setsockopt(fd, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &mr6, sizeof(mr6));
+        r = setsockopt(fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, &mr6, sizeof(mr6));
     }
 
     if (r < 0) {

Modified: trunk/src/modules/rtp/sap.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/rtp/sap.c?rev=1096&root=pulseaudio&r1=1095&r2=1096&view=diff
==============================================================================
--- trunk/src/modules/rtp/sap.c (original)
+++ trunk/src/modules/rtp/sap.c Mon Jul 17 01:20:27 2006
@@ -28,6 +28,7 @@
 #include <stdlib.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <netinet/in.h>
 #include <arpa/inet.h>
 #include <errno.h>
 #include <string.h>

Modified: trunk/src/modules/rtp/sdp.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/rtp/sdp.c?rev=1096&root=pulseaudio&r1=1095&r2=1096&view=diff
==============================================================================
--- trunk/src/modules/rtp/sdp.c (original)
+++ trunk/src/modules/rtp/sdp.c Mon Jul 17 01:20:27 2006
@@ -28,6 +28,7 @@
 #include <stdlib.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <netinet/in.h>
 #include <arpa/inet.h>
 #include <string.h>
 

Modified: trunk/src/utils/padsp.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/utils/padsp.c?rev=1096&root=pulseaudio&r1=1095&r2=1096&view=diff
==============================================================================
--- trunk/src/utils/padsp.c (original)
+++ trunk/src/utils/padsp.c Mon Jul 17 01:20:27 2006
@@ -36,6 +36,7 @@
 #include <pthread.h>
 #include <unistd.h>
 #include <sys/socket.h>
+#include <sys/stat.h>
 #include <dlfcn.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -44,7 +45,9 @@
 #include <stdio.h>
 #include <signal.h>
 
+#ifdef __linux__
 #include <linux/sockios.h>
+#endif
 
 #include <pulse/pulseaudio.h>
 #include <pulsecore/llist.h>
@@ -101,8 +104,10 @@
 static int (*_close)(int) = NULL;
 static int (*_open)(const char *, int, mode_t) = NULL;
 static FILE* (*_fopen)(const char *path, const char *mode) = NULL;
+#ifdef HAVE_OPEN64
 static int (*_open64)(const char *, int, mode_t) = NULL;
 static FILE* (*_fopen64)(const char *path, const char *mode) = NULL;
+#endif
 static int (*_fclose)(FILE *f) = NULL;
 static int (*_access)(const char *, int) = NULL;
 
@@ -1302,7 +1307,11 @@
 
     debug(DEBUG_LEVEL_NORMAL, __FILE__": sndstat_open()\n");
     
-    if (flags != O_RDONLY && flags != (O_RDONLY|O_LARGEFILE)) {
+    if (flags != O_RDONLY
+#ifdef O_LARGEFILE
+	&& flags != (O_RDONLY|O_LARGEFILE)
+#endif
+       ) {
         *_errno = EACCES;
         debug(DEBUG_LEVEL_NORMAL, __FILE__": bad access!\n");
         goto fail;
@@ -1349,8 +1358,12 @@
     debug(DEBUG_LEVEL_VERBOSE, __FILE__": open(%s)\n", filename);
 
     va_start(args, flags);
-    if (flags & O_CREAT)
+    if (flags & O_CREAT) {
+      if (sizeof(mode_t) < sizeof(int))
+	mode = va_arg(args, int);
+      else
         mode = va_arg(args, mode_t);
+    }
     va_end(args);
 
     if (!function_enter()) {
@@ -1587,6 +1600,7 @@
 }
 
 static int dsp_flush_fd(int fd) {
+#ifdef SIOCINQ
     int l;
 
     if (ioctl(fd, SIOCINQ, &l) < 0) {
@@ -1605,6 +1619,10 @@
     }
 
     return 0;
+#else
+# warning "Your platform does not support SIOCINQ, something might not work as intended."
+    return 0;
+#endif
 }
 
 static int dsp_flush_socket(fd_info *i) {
@@ -1629,6 +1647,7 @@
 }
 
 static int dsp_empty_socket(fd_info *i) {
+#ifdef SIOCINQ
     int ret = -1;
     
     /* Empty the socket */
@@ -1652,6 +1671,10 @@
     }
 
     return ret;
+#else
+# warning "Your platform does not support SIOCINQ, something might not work as intended."
+    return 0;
+#endif
 }
 
 static int dsp_drain(fd_info *i) {
@@ -1864,7 +1887,11 @@
         case SNDCTL_DSP_GETCAPS:
             debug(DEBUG_LEVEL_NORMAL, __FILE__": SNDCTL_DSP_CAPS\n");
             
-            *(int*)  argp = DSP_CAP_DUPLEX | DSP_CAP_MULTI;
+            *(int*)  argp = DSP_CAP_DUPLEX
+#ifdef DSP_CAP_MULTI
+	      | DSP_CAP_MULTI
+#endif
+	      ;
             break;
 
         case SNDCTL_DSP_GETODELAY: {
@@ -1895,11 +1922,15 @@
             }
             
         exit_loop:
-            
+
+#ifdef SIOCINQ            
             if (ioctl(i->thread_fd, SIOCINQ, &l) < 0)
                 debug(DEBUG_LEVEL_NORMAL, __FILE__": SIOCINQ failed: %s\n", strerror(errno));
             else
                 *(int*) argp += l;
+#else
+# warning "Your platform does not support SIOCINQ, something might not work as intended."
+#endif
 
             pa_threaded_mainloop_unlock(i->mainloop);
 
@@ -1946,7 +1977,7 @@
         case SNDCTL_DSP_GETOSPACE:
         case SNDCTL_DSP_GETISPACE: {
             audio_buf_info *bi = (audio_buf_info*) argp;
-            int l;
+            int l = 0;
             size_t k = 0;
 
             if (request == SNDCTL_DSP_GETOSPACE)
@@ -1965,10 +1996,14 @@
                 } else
                     k = i->fragment_size * i->n_fragments;
 
+#ifdef SIOCINQ
                 if (ioctl(i->thread_fd, SIOCINQ, &l) < 0) {
                     debug(DEBUG_LEVEL_NORMAL, __FILE__": SIOCINQ failed: %s\n", strerror(errno));
                     l = 0;
                 }
+#else
+# warning "Your platform does not dsp_flush_fd, something might not work as intended."
+#endif
 
                 bi->bytes = k > (size_t) l ? k - l : 0;
             } else {
@@ -1978,11 +2013,14 @@
                 } else
                     k = 0;
 
+#ifdef SIOCINQ
                 if (ioctl(i->app_fd, SIOCINQ, &l) < 0) {
                     debug(DEBUG_LEVEL_NORMAL, __FILE__": SIOCINQ failed: %s\n", strerror(errno));
                     l = 0;
                 }
-
+#else
+# warning "Your platform does not dsp_flush_fd, something might not work as intended."
+#endif
                 bi->bytes = k + l;
             }
 
@@ -2104,6 +2142,8 @@
     return 0;
 }
 
+#ifdef HAVE_OPEN64
+
 int open64(const char *filename, int flags, ...) {
     va_list args;
     mode_t mode = 0;
@@ -2125,6 +2165,8 @@
 
     return open(filename, flags, mode);
 }
+
+#endif
 
 FILE* fopen(const char *filename, const char *mode) {
     FILE *f = NULL;
@@ -2168,6 +2210,8 @@
     return f;
 }
 
+#ifdef HAVE_OPEN64
+
 FILE *fopen64(const char *filename, const char *mode) {
 
     debug(DEBUG_LEVEL_VERBOSE, __FILE__": fopen64(%s)\n", filename);
@@ -2183,6 +2227,8 @@
     return fopen(filename, mode);
 }
 
+#endif
+
 int fclose(FILE *f) {
     fd_info *i;
 




More information about the pulseaudio-commits mailing list