[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.16-test1-17-g1ca7603

Lennart Poettering gitmailer-noreply at 0pointer.de
Mon Jun 29 08:53:11 PDT 2009


This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.

The master branch has been updated
      from  2654eb7781ddcfe53064745bbad77bffe5c8eada (commit)

- Log -----------------------------------------------------------------
1ca7603 Add missing headers includes for FreeBSD.
bce211e Rename the flock variable to f_lock.
6f44792 Only declare saved_errno when it's going to be used (on Linux).
9a2ac32 Rename the wait parameter to wait_op, to avoid shadowing wait().
2266a39 Remove the call for pa_rtpoll_install() in the Solaris module.
24564af Fix the moved rtclock.h header in the Solaris module.
de40e41 Also alias MAP_ANONYMOUS to MAP_ANON in shm.c, for FreeBSD.
2f7bce9 Add a missing sys/stat.h include for FreeBSD to declare umask().
fc649ad Don't try to compile the rtkit sources when dbus is not enabled.
ad4e025 Implement mix-test for s24le and s24be sample formats.
595f80f Use static constants to keep the generated sample blocks.
080f630 Ignore IPv6 tests, if IPv6 was built in but the system doesn't have it.
cd375da Use the new CC_CHECK_CFLAGS_APPEND macro instead of a manual for.
e7c3a12 Properly link module-zeroconf-publish against libnative-protocol.
a4703ce Check for and use flags to reject undefined symbols in libraries.
e61795c Update attributes.m4 file from xine-lib.
e832383 Make it more clear that PulseAudio needs libtool 2.2.
-----------------------------------------------------------------------

Summary of changes:
 configure.ac                 |   13 +++---
 m4/attributes.m4             |   59 ++++++++++++++++++++++++-
 src/Makefile.am              |    9 ++--
 src/daemon/main.c            |    1 +
 src/modules/module-solaris.c |    3 +-
 src/pulse/thread-mainloop.c  |    4 ++
 src/pulsecore/asyncq.c       |   18 ++++----
 src/pulsecore/core-util.c    |   20 ++++----
 src/pulsecore/rtpoll.c       |    8 ++--
 src/pulsecore/shm.c          |    5 ++
 src/tests/ipacl-test.c       |    6 ++-
 src/tests/mix-test.c         |   95 +++++++++++++++++++++--------------------
 12 files changed, 155 insertions(+), 86 deletions(-)

-----------------------------------------------------------------------

commit e83238319720c92bb63d9a79a8730ad6fca83ba0
Author: Diego Elio 'Flameeyes' Pettenò <flameeyes at gmail.com>
Date:   Sat Jun 13 17:27:42 2009 +0200

    Make it more clear that PulseAudio needs libtool 2.2.
    
    The error message was way too generic, as it was very possible that libltdl
    _is_ in the system but is not found because too old. Disambiguate this by
    explicitly stating that the version 2 of the library is not found.

diff --git a/configure.ac b/configure.ac
index d2d8015..06539b3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -277,7 +277,7 @@ AC_CHECK_HEADER([ltdl.h],
     [LIBLTDL=])
 
 AS_IF([test "x$LIBLTDL" = "x"],
-    [AC_MSG_ERROR([Unable to find libltdl.])])
+    [AC_MSG_ERROR([Unable to find libltdl version 2. Makes sure you have libtool 2.2 or later installed.])])
 AC_SUBST([LIBLTDL])
 
 #### Determine build environment ####

commit e61795ce53dd2ac08ca50470f7238442aed72aef
Author: Diego Elio 'Flameeyes' Pettenò <flameeyes at gmail.com>
Date:   Wed Jun 24 17:32:28 2009 +0200

    Update attributes.m4 file from xine-lib.

diff --git a/m4/attributes.m4 b/m4/attributes.m4
index 65f8378..28fac27 100644
--- a/m4/attributes.m4
+++ b/m4/attributes.m4
@@ -1,6 +1,6 @@
 dnl Macros to check the presence of generic (non-typed) symbols.
-dnl Copyright (c) 2006-2007 Diego Pettenò <flameeyes at gmail.com>
-dnl Copyright (c) 2006-2007 xine project
+dnl Copyright (c) 2006-2008 Diego Pettenò <flameeyes at gmail.com>
+dnl Copyright (c) 2006-2008 xine project
 dnl
 dnl This program is free software; you can redistribute it and/or modify
 dnl it under the terms of the GNU General Public License as published by
@@ -32,6 +32,9 @@ dnl distribute a modified version of the Autoconf Macro, you may extend
 dnl this special exception to the GPL to apply to your modified version as
 dnl well.
 
+dnl Check if the flag is supported by compiler
+dnl CC_CHECK_CFLAGS_SILENT([FLAG], [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
+
 AC_DEFUN([CC_CHECK_CFLAGS_SILENT], [
   AC_CACHE_VAL(AS_TR_SH([cc_cv_cflags_$1]),
     [ac_save_CFLAGS="$CFLAGS"
@@ -46,6 +49,9 @@ AC_DEFUN([CC_CHECK_CFLAGS_SILENT], [
     [$2], [$3])
 ])
 
+dnl Check if the flag is supported by compiler (cacheable)
+dnl CC_CHECK_CFLAGS([FLAG], [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
+
 AC_DEFUN([CC_CHECK_CFLAGS], [
   AC_CACHE_CHECK([if $CC supports $1 flag],
     AS_TR_SH([cc_cv_cflags_$1]),
@@ -56,6 +62,28 @@ AC_DEFUN([CC_CHECK_CFLAGS], [
     [$2], [$3])
 ])
 
+dnl CC_CHECK_CFLAG_APPEND(FLAG, [action-if-found], [action-if-not-found])
+dnl Check for CFLAG and appends them to CFLAGS if supported
+AC_DEFUN([CC_CHECK_CFLAG_APPEND], [
+  AC_CACHE_CHECK([if $CC supports $1 flag],
+    AS_TR_SH([cc_cv_cflags_$1]),
+    CC_CHECK_CFLAGS_SILENT([$1]) dnl Don't execute actions here!
+  )
+
+  AS_IF([eval test x$]AS_TR_SH([cc_cv_cflags_$1])[ = xyes],
+    [CFLAGS="$CFLAGS $1"; DEBUG_CFLAGS="$DEBUG_CFLAGS $1"; $2], [$3])
+])
+
+dnl CC_CHECK_CFLAGS_APPEND([FLAG1 FLAG2], [action-if-found], [action-if-not])
+AC_DEFUN([CC_CHECK_CFLAGS_APPEND], [
+  for flag in $1; do
+    CC_CHECK_CFLAG_APPEND($flag, [$2], [$3])
+  done
+])
+
+dnl Check if the flag is supported by linker (cacheable)
+dnl CC_CHECK_LDFLAGS([FLAG], [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
+
 AC_DEFUN([CC_CHECK_LDFLAGS], [
   AC_CACHE_CHECK([if $CC supports $1 flag],
     AS_TR_SH([cc_cv_ldflags_$1]),
@@ -63,7 +91,7 @@ AC_DEFUN([CC_CHECK_LDFLAGS], [
      LDFLAGS="$LDFLAGS $1"
      AC_LINK_IFELSE([int main() { return 1; }],
        [eval "AS_TR_SH([cc_cv_ldflags_$1])='yes'"],
-       [eval "AS_TR_SH([cc_cv_ldflags_$1])='no'"])
+       [eval "AS_TR_SH([cc_cv_ldflags_$1])="])
      LDFLAGS="$ac_save_LDFLAGS"
     ])
 
@@ -71,6 +99,31 @@ AC_DEFUN([CC_CHECK_LDFLAGS], [
     [$2], [$3])
 ])
 
+dnl define the LDFLAGS_NOUNDEFINED variable with the correct value for
+dnl the current linker to avoid undefined references in a shared object.
+AC_DEFUN([CC_NOUNDEFINED], [
+  dnl We check $host for which systems to enable this for.
+  AC_REQUIRE([AC_CANONICAL_HOST])
+
+  case $host in
+     dnl FreeBSD (et al.) does not complete linking for shared objects when pthreads
+     dnl are requested, as different implementations are present; to avoid problems
+     dnl use -Wl,-z,defs only for those platform not behaving this way.
+     *-freebsd* | *-openbsd*) ;;
+     *)
+        dnl First of all check for the --no-undefined variant of GNU ld. This allows
+        dnl for a much more readable commandline, so that people can understand what
+        dnl it does without going to look for what the heck -z defs does.
+        for possible_flags in "-Wl,--no-undefined" "-Wl,-z,defs"; do
+          CC_CHECK_LDFLAGS([$possible_flags], [LDFLAGS_NOUNDEFINED="$possible_flags"])
+	  break
+        done
+	;;
+  esac
+
+  AC_SUBST([LDFLAGS_NOUNDEFINED])
+])
+
 dnl Check for a -Werror flag or equivalent. -Werror is the GCC
 dnl and ICC flag that tells the compiler to treat all the warnings
 dnl as fatal. We usually need this option to make sure that some

commit a4703ce7e8be3be6dfa3511f5b4356720589754a
Author: Diego Elio 'Flameeyes' Pettenò <flameeyes at gmail.com>
Date:   Wed Jun 24 17:39:25 2009 +0200

    Check for and use flags to reject undefined symbols in libraries.
    
    Make sure that all the PulseAudio modules are built properly without
    outstanding undefined symbols: if the undefined symbols are found, reject
    link.

diff --git a/configure.ac b/configure.ac
index 06539b3..931b57d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -117,6 +117,11 @@ CC_CHECK_LDFLAGS([${tmp_ldflag}],
     [VERSIONING_LDFLAGS='-Wl,-version-script=$(srcdir)/map-file'])
 AC_SUBST([VERSIONING_LDFLAGS])
 
+dnl Check for the proper way to build libraries that have no undefined
+dnl symbols; on some hosts this needs to be avoided but the macro
+dnl takes care of it.
+CC_NOUNDEFINED
+
 dnl Check whether to build tests by default (as compile-test) or not
 AC_ARG_ENABLE([default-build-tests],
     AS_HELP_STRING([--disable-default-build-tests], [Build test programs only during make check]))
diff --git a/src/Makefile.am b/src/Makefile.am
index ae90ae8..f365132 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -99,7 +99,7 @@ WINSOCK_LIBS=-lwsock32 -lws2_32 -lwininet
 endif
 
 FOREIGN_CFLAGS = -w
-MODULE_LDFLAGS = -module -disable-static -avoid-version
+MODULE_LDFLAGS = -module -disable-static -avoid-version $(LDFLAGS_NOUNDEFINED)
 
 ###################################
 #          Extra files            #

commit e7c3a12a6e628acb460f6c5eb46a8c5631194f1c
Author: Diego Elio 'Flameeyes' Pettenò <flameeyes at gmail.com>
Date:   Wed Jun 24 17:40:43 2009 +0200

    Properly link module-zeroconf-publish against libnative-protocol.
    
    Without this change, undefined symbols will be found in the module and the
    link will be rejected (thanks to the just-made change to reject outstanding
    undefined symbols).
    
    Also, in -test1, without this change it would have caused the module to not
    load because of missing symbols.

diff --git a/src/Makefile.am b/src/Makefile.am
index f365132..5d6fbd9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1442,7 +1442,7 @@ module_solaris_la_LIBADD = $(AM_LIBADD) libpulsecore- at PA_MAJORMINORMICRO@.la lib
 
 module_zeroconf_publish_la_SOURCES = modules/module-zeroconf-publish.c
 module_zeroconf_publish_la_LDFLAGS = $(MODULE_LDFLAGS)
-module_zeroconf_publish_la_LIBADD = $(AM_LIBADD) $(AVAHI_LIBS) libavahi-wrap.la libpulsecore- at PA_MAJORMINORMICRO@.la libpulsecommon- at PA_MAJORMINORMICRO@.la libpulse.la
+module_zeroconf_publish_la_LIBADD = $(AM_LIBADD) $(AVAHI_LIBS) libavahi-wrap.la libprotocol-native.la libpulsecore- at PA_MAJORMINORMICRO@.la libpulsecommon- at PA_MAJORMINORMICRO@.la libpulse.la
 module_zeroconf_publish_la_CFLAGS = $(AM_CFLAGS) $(AVAHI_CFLAGS)
 
 module_zeroconf_discover_la_SOURCES = modules/module-zeroconf-discover.c

commit cd375da1dbf3f10c31167a128ef2f355eb01bd6e
Author: Diego Elio 'Flameeyes' Pettenò <flameeyes at gmail.com>
Date:   Wed Jun 24 17:45:58 2009 +0200

    Use the new CC_CHECK_CFLAGS_APPEND macro instead of a manual for.

diff --git a/configure.ac b/configure.ac
index 931b57d..00121f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -100,11 +100,7 @@ if test "x$M4" = xno ; then
 fi
 
 dnl Compiler flags
-DESIRED_FLAGS="-Wall -W -Wextra -pipe -Wno-long-long -Winline -Wvla -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option"
-
-for flag in $DESIRED_FLAGS ; do
-  CC_CHECK_CFLAGS([$flag], [CFLAGS="$CFLAGS $flag"])
-done
+CC_CHECK_CFLAGS_APPEND([-Wall -W -Wextra -pipe -Wno-long-long -Winline -Wvla -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option])
 
 dnl Linker flags.
 dnl Check whether the linker supports the -version-script option.

commit 080f6308f2c01ecce77bc4b7f93b061194791e00
Author: Diego Elio 'Flameeyes' Pettenò <flameeyes at gmail.com>
Date:   Wed Jun 24 18:03:40 2009 +0200

    Ignore IPv6 tests, if IPv6 was built in but the system doesn't have it.
    
    This removes a test failure when an IPv6-enabled PulseAudio is tested on a
    system where IPv6 is not enabled in kernel.

diff --git a/src/tests/ipacl-test.c b/src/tests/ipacl-test.c
index f89665c..57b7068 100644
--- a/src/tests/ipacl-test.c
+++ b/src/tests/ipacl-test.c
@@ -91,8 +91,10 @@ int main(int argc, char *argv[]) {
     close(fd);
 
 #ifdef HAVE_IPV6
-    fd = socket(PF_INET6, SOCK_STREAM, 0);
-    assert(fd >= 0);
+    if ( (fd = socket(PF_INET6, SOCK_STREAM, 0)) < 0 ) {
+      printf("Unable to open IPv6 socket, IPv6 tests ignored");
+      return 0;
+    }
 
     memset(&sa6, 0, sizeof(sa6));
     sa6.sin6_family = AF_INET6;

commit 595f80fef79bf95bd1c20aad9dc31d6d937a3643
Author: Diego Elio 'Flameeyes' Pettenò <flameeyes at gmail.com>
Date:   Wed Jun 24 18:23:14 2009 +0200

    Use static constants to keep the generated sample blocks.

diff --git a/src/tests/mix-test.c b/src/tests/mix-test.c
index ac4b57b..b1dac3b 100644
--- a/src/tests/mix-test.c
+++ b/src/tests/mix-test.c
@@ -113,73 +113,47 @@ static pa_memblock* generate_block(pa_mempool *pool, const pa_sample_spec *ss) {
         case PA_SAMPLE_U8:
         case PA_SAMPLE_ULAW:
         case PA_SAMPLE_ALAW: {
-            uint8_t *u = d;
+	    static const uint8_t u8_samples[] =
+	      { 0x00, 0xFF, 0x7F, 0x80, 0x9f,
+		0x3f, 0x01, 0xF0, 0x20, 0x21 };
 
-            u[0] = 0x00;
-            u[1] = 0xFF;
-            u[2] = 0x7F;
-            u[3] = 0x80;
-            u[4] = 0x9f;
-            u[5] = 0x3f;
-            u[6] = 0x1;
-            u[7] = 0xF0;
-            u[8] = 0x20;
-            u[9] = 0x21;
+	    memcpy(d, &u8_samples[0], sizeof(u8_samples));
             break;
         }
 
         case PA_SAMPLE_S16NE:
         case PA_SAMPLE_S16RE: {
-            uint16_t *u = d;
+	    static const uint16_t u16_samples[] =
+	      { 0x0000, 0xFFFF, 0x7FFF, 0x8000, 0x9fff,
+		0x3fff, 0x0001, 0xF000, 0x0020, 0x0021 };
 
-            u[0] = 0x0000;
-            u[1] = 0xFFFF;
-            u[2] = 0x7FFF;
-            u[3] = 0x8000;
-            u[4] = 0x9fff;
-            u[5] = 0x3fff;
-            u[6] = 0x1;
-            u[7] = 0xF000;
-            u[8] = 0x20;
-            u[9] = 0x21;
+	    memcpy(d, &u16_samples[0], sizeof(u16_samples));
             break;
         }
 
         case PA_SAMPLE_S32NE:
         case PA_SAMPLE_S32RE: {
-            uint32_t *u = d;
+	    static const uint32_t u32_samples[] =
+	      { 0x00000001, 0xFFFF0002, 0x7FFF0003, 0x80000004, 0x9fff0005,
+		0x3fff0006, 0x00010007, 0xF0000008, 0x00200009, 0x0021000A };
 
-            u[0] = 0x00000001;
-            u[1] = 0xFFFF0002;
-            u[2] = 0x7FFF0003;
-            u[3] = 0x80000004;
-            u[4] = 0x9fff0005;
-            u[5] = 0x3fff0006;
-            u[6] =    0x10007;
-            u[7] = 0xF0000008;
-            u[8] =   0x200009;
-            u[9] =   0x21000A;
+	    memcpy(d, &u32_samples[0], sizeof(u32_samples));
             break;
         }
 
         case PA_SAMPLE_FLOAT32NE:
         case PA_SAMPLE_FLOAT32RE: {
             float *u = d;
+	    static const float float_samples[] =
+	      { 0.0f, -1.0f, 1.0f, 4711.0f, 0.222f,
+		0.33f, -.3f, 99.0f, -0.555f, -.123f };
 
-            u[0] = 0.0f;
-            u[1] = -1.0f;
-            u[2] = 1.0f;
-            u[3] = 4711.0f;
-            u[4] = 0.222f;
-            u[5] = 0.33f;
-            u[6] = -.3f;
-            u[7] = 99.0f;
-            u[8] = -0.555f;
-            u[9] = -.123f;
-
-            if (ss->format == PA_SAMPLE_FLOAT32RE)
+            if (ss->format == PA_SAMPLE_FLOAT32RE) {
                 for (i = 0; i < 10; i++)
-                    u[i] = swap_float(u[i]);
+                    u[i] = swap_float(float_samples[i]);
+	    } else {
+	      memcpy(d, &float_samples[0], sizeof(float_samples));
+	    }
 
             break;
         }

commit ad4e025ef5257baeb48e670b03522758ca68f5cf
Author: Diego Elio 'Flameeyes' Pettenò <flameeyes at gmail.com>
Date:   Wed Jun 24 18:24:45 2009 +0200

    Implement mix-test for s24le and s24be sample formats.

diff --git a/src/tests/mix-test.c b/src/tests/mix-test.c
index b1dac3b..c7a30d6 100644
--- a/src/tests/mix-test.c
+++ b/src/tests/mix-test.c
@@ -79,6 +79,16 @@ static void dump_block(const pa_sample_spec *ss, const pa_memchunk *chunk) {
             break;
         }
 
+        case PA_SAMPLE_S24NE:
+        case PA_SAMPLE_S24RE: {
+            uint8_t *u = d;
+
+            for (i = 0; i < chunk->length / pa_frame_size(ss); i++)
+	        printf("0x%02x%02x%02xx ", *(u++), *(u++), *(u++));
+
+            break;
+        }
+
         case PA_SAMPLE_FLOAT32NE:
         case PA_SAMPLE_FLOAT32RE: {
             float *u = d;
@@ -141,6 +151,25 @@ static pa_memblock* generate_block(pa_mempool *pool, const pa_sample_spec *ss) {
             break;
         }
 
+        case PA_SAMPLE_S24NE:
+        case PA_SAMPLE_S24RE: {
+	    /* Need to be on a byte array because they are not aligned */
+	    static const uint8_t u24_samples[] =
+	      { 0x00, 0x00, 0x01,
+		0xFF, 0xFF, 0x02,
+		0x7F, 0xFF, 0x03,
+		0x80, 0x00, 0x04,
+		0x9f, 0xff, 0x05,
+		0x3f, 0xff, 0x06,
+		0x01, 0x00, 0x07,
+		0xF0, 0x00, 0x08,
+		0x20, 0x00, 0x09,
+		0x21, 0x00, 0x0A };
+
+	    memcpy(d, &u24_samples[0], sizeof(u24_samples));
+            break;
+        }
+
         case PA_SAMPLE_FLOAT32NE:
         case PA_SAMPLE_FLOAT32RE: {
             float *u = d;

commit fc649adf9dccda542b80dd5b67d148e92b2a0af4
Author: Diego Elio 'Flameeyes' Pettenò <flameeyes at gmail.com>
Date:   Wed Jun 24 21:49:45 2009 +0200

    Don't try to compile the rtkit sources when dbus is not enabled.
    
    This change only affects the buildsystem: source code was correct already.

diff --git a/src/Makefile.am b/src/Makefile.am
index 5d6fbd9..c221982 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -568,7 +568,6 @@ libpulsecommon_ at PA_MAJORMINORMICRO@_la_SOURCES = \
 		pulsecore/core-error.c pulsecore/core-error.h \
 		pulsecore/core-rtclock.c pulsecore/core-rtclock.h \
 		pulsecore/core-util.c pulsecore/core-util.h \
-		pulsecore/rtkit.c pulsecore/rtkit.h \
 		pulsecore/creds.h \
 		pulsecore/dynarray.c pulsecore/dynarray.h \
 		pulsecore/endianmacros.h \
@@ -659,7 +658,9 @@ libpulsecommon_ at PA_MAJORMINORMICRO@_la_SOURCES += pulsecore/dllmain.c
 endif
 
 if HAVE_DBUS
-libpulsecommon_ at PA_MAJORMINORMICRO@_la_SOURCES += pulsecore/dbus-util.c pulsecore/dbus-util.h
+libpulsecommon_ at PA_MAJORMINORMICRO@_la_SOURCES += \
+		pulsecore/dbus-util.c pulsecore/dbus-util.h \
+		pulsecore/rtkit.c pulsecore/rtkit.h
 libpulsecommon_ at PA_MAJORMINORMICRO@_la_CFLAGS += $(DBUS_CFLAGS)
 libpulsecommon_ at PA_MAJORMINORMICRO@_la_LIBADD += $(DBUS_LIBS)
 endif

commit 2f7bce9375f089d8a7668e1a66e64be0d9892345
Author: Diego Elio 'Flameeyes' Pettenò <flameeyes at gmail.com>
Date:   Wed Jun 24 22:01:55 2009 +0200

    Add a missing sys/stat.h include for FreeBSD to declare umask().

diff --git a/src/daemon/main.c b/src/daemon/main.c
index b58bb37..eb378d2 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -37,6 +37,7 @@
 #include <unistd.h>
 #include <locale.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 
 #include <liboil/liboil.h>
 

commit de40e41446c1317104869d0b0cccb2068da3639b
Author: Diego Elio 'Flameeyes' Pettenò <flameeyes at gmail.com>
Date:   Wed Jun 24 22:08:41 2009 +0200

    Also alias MAP_ANONYMOUS to MAP_ANON in shm.c, for FreeBSD.

diff --git a/src/pulsecore/shm.c b/src/pulsecore/shm.c
index fab2b3b..6e42842 100644
--- a/src/pulsecore/shm.c
+++ b/src/pulsecore/shm.c
@@ -39,6 +39,11 @@
 #include <sys/mman.h>
 #endif
 
+/* This is deprecated on glibc but is still used by FreeBSD */
+#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
+# define MAP_ANONYMOUS MAP_ANON
+#endif
+
 #include <pulse/xmalloc.h>
 #include <pulse/gccmacro.h>
 

commit 24564afc4346055e85adf48707ac0daba3514bb9
Author: Diego Elio 'Flameeyes' Pettenò <flameeyes at gmail.com>
Date:   Thu Jun 25 11:47:23 2009 +0200

    Fix the moved rtclock.h header in the Solaris module.

diff --git a/src/modules/module-solaris.c b/src/modules/module-solaris.c
index 08fe6f5..e619105 100644
--- a/src/modules/module-solaris.c
+++ b/src/modules/module-solaris.c
@@ -46,6 +46,7 @@
 #include <pulse/xmalloc.h>
 #include <pulse/timeval.h>
 #include <pulse/util.h>
+#include <pulse/rtclock.h>
 
 #include <pulsecore/iochannel.h>
 #include <pulsecore/sink.h>
@@ -59,7 +60,6 @@
 #include <pulsecore/thread-mq.h>
 #include <pulsecore/rtpoll.h>
 #include <pulsecore/thread.h>
-#include <pulsecore/rtclock.h>
 
 #include "module-solaris-symdef.h"
 

commit 2266a39bd32173b6c4b4ac67c065dc3321cf799b
Author: Diego Elio 'Flameeyes' Pettenò <flameeyes at gmail.com>
Date:   Thu Jun 25 11:47:44 2009 +0200

    Remove the call for pa_rtpoll_install() in the Solaris module.
    
    I hope this is enough, since the removal of the other pa_rtpoll_install()
    calls deemed Linux good enough, but said nothing about Solaris, but since
    the function is gone there is little more to do.

diff --git a/src/modules/module-solaris.c b/src/modules/module-solaris.c
index e619105..0920d25 100644
--- a/src/modules/module-solaris.c
+++ b/src/modules/module-solaris.c
@@ -605,7 +605,6 @@ static void thread_func(void *userdata) {
         pa_make_realtime(u->core->realtime_priority);
 
     pa_thread_mq_install(&u->thread_mq);
-    pa_rtpoll_install(u->rtpoll);
 
     for (;;) {
         /* Render some data and write it to the dsp */

commit 9a2ac32dcd337cf3dc2293cac73756c66d7891b8
Author: Diego Elio 'Flameeyes' Pettenò <flameeyes at gmail.com>
Date:   Thu Jun 25 11:50:10 2009 +0200

    Rename the wait parameter to wait_op, to avoid shadowing wait().

diff --git a/src/pulsecore/asyncq.c b/src/pulsecore/asyncq.c
index 67f661f..072ef02 100644
--- a/src/pulsecore/asyncq.c
+++ b/src/pulsecore/asyncq.c
@@ -131,7 +131,7 @@ void pa_asyncq_free(pa_asyncq *l, pa_free_cb_t free_cb) {
     pa_xfree(l);
 }
 
-static int push(pa_asyncq*l, void *p, pa_bool_t wait) {
+static int push(pa_asyncq*l, void *p, pa_bool_t wait_op) {
     unsigned idx;
     pa_atomic_ptr_t *cells;
 
@@ -145,7 +145,7 @@ static int push(pa_asyncq*l, void *p, pa_bool_t wait) {
 
     if (!pa_atomic_ptr_cmpxchg(&cells[idx], NULL, p)) {
 
-        if (!wait)
+        if (!wait_op)
             return -1;
 
 /*         pa_log("sleeping on push"); */
@@ -163,14 +163,14 @@ static int push(pa_asyncq*l, void *p, pa_bool_t wait) {
     return 0;
 }
 
-static pa_bool_t flush_postq(pa_asyncq *l, pa_bool_t wait) {
+static pa_bool_t flush_postq(pa_asyncq *l, pa_bool_t wait_op) {
     struct localq *q;
 
     pa_assert(l);
 
     while ((q = l->last_localq)) {
 
-        if (push(l, q->data, wait) < 0)
+        if (push(l, q->data, wait_op) < 0)
             return FALSE;
 
         l->last_localq = q->prev;
@@ -184,13 +184,13 @@ static pa_bool_t flush_postq(pa_asyncq *l, pa_bool_t wait) {
     return TRUE;
 }
 
-int pa_asyncq_push(pa_asyncq*l, void *p, pa_bool_t wait) {
+int pa_asyncq_push(pa_asyncq*l, void *p, pa_bool_t wait_op) {
     pa_assert(l);
 
-    if (!flush_postq(l, wait))
+    if (!flush_postq(l, wait_op))
         return -1;
 
-    return push(l, p, wait);
+    return push(l, p, wait_op);
 }
 
 void pa_asyncq_post(pa_asyncq*l, void *p) {
@@ -221,7 +221,7 @@ void pa_asyncq_post(pa_asyncq*l, void *p) {
     return;
 }
 
-void* pa_asyncq_pop(pa_asyncq*l, pa_bool_t wait) {
+void* pa_asyncq_pop(pa_asyncq*l, pa_bool_t wait_op) {
     unsigned idx;
     void *ret;
     pa_atomic_ptr_t *cells;
@@ -235,7 +235,7 @@ void* pa_asyncq_pop(pa_asyncq*l, pa_bool_t wait) {
 
     if (!(ret = pa_atomic_ptr_load(&cells[idx]))) {
 
-        if (!wait)
+        if (!wait_op)
             return NULL;
 
 /*         pa_log("sleeping on pop"); */
diff --git a/src/pulsecore/rtpoll.c b/src/pulsecore/rtpoll.c
index 5cbec32..42708a8 100644
--- a/src/pulsecore/rtpoll.c
+++ b/src/pulsecore/rtpoll.c
@@ -220,7 +220,7 @@ static void reset_all_revents(pa_rtpoll *p) {
     }
 }
 
-int pa_rtpoll_run(pa_rtpoll *p, pa_bool_t wait) {
+int pa_rtpoll_run(pa_rtpoll *p, pa_bool_t wait_op) {
     pa_rtpoll_item *i;
     int r = 0;
     struct timeval timeout;
@@ -289,7 +289,7 @@ int pa_rtpoll_run(pa_rtpoll *p, pa_bool_t wait) {
     memset(&timeout, 0, sizeof(timeout));
 
     /* Calculate timeout */
-    if (wait && !p->quit && p->timer_enabled) {
+    if (wait_op && !p->quit && p->timer_enabled) {
         struct timeval now;
         pa_rtclock_get(&now);
 
@@ -311,10 +311,10 @@ int pa_rtpoll_run(pa_rtpoll *p, pa_bool_t wait) {
         struct timespec ts;
         ts.tv_sec = timeout.tv_sec;
         ts.tv_nsec = timeout.tv_usec * 1000;
-        r = ppoll(p->pollfd, p->n_pollfd_used, (!wait || p->quit || p->timer_enabled) ? &ts : NULL, NULL);
+        r = ppoll(p->pollfd, p->n_pollfd_used, (!wait_op || p->quit || p->timer_enabled) ? &ts : NULL, NULL);
     }
 #else
-        r = poll(p->pollfd, p->n_pollfd_used, (!wait || p->quit || p->timer_enabled) ? (int) ((timeout.tv_sec*1000) + (timeout.tv_usec / 1000)) : -1);
+        r = poll(p->pollfd, p->n_pollfd_used, (!wait_op || p->quit || p->timer_enabled) ? (int) ((timeout.tv_sec*1000) + (timeout.tv_usec / 1000)) : -1);
 #endif
 
 #ifdef DEBUG_TIMING

commit 6f447928066626e747df8f32485e71c393119a79
Author: Diego Elio 'Flameeyes' Pettenò <flameeyes at gmail.com>
Date:   Thu Jun 25 12:07:12 2009 +0200

    Only declare saved_errno when it's going to be used (on Linux).

diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 4550344..6c94a71 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -2238,10 +2238,9 @@ int pa_close_all(int except_fd, ...) {
 int pa_close_allv(const int except_fds[]) {
     struct rlimit rl;
     int maxfd, fd;
-    int saved_errno;
 
 #ifdef __linux__
-
+    int saved_errno;
     DIR *d;
 
     if ((d = opendir("/proc/self/fd"))) {

commit bce211e41687f234f8c03fd6e4fd7490a0e0b7e2
Author: Diego Elio 'Flameeyes' Pettenò <flameeyes at gmail.com>
Date:   Thu Jun 25 12:28:16 2009 +0200

    Rename the flock variable to f_lock.
    
    flock() is a function on FreeBSD, and the variable shadowed its definition.

diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 6c94a71..9511142 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -1193,22 +1193,22 @@ int pa_check_in_group(gid_t g) {
   (advisory on UNIX, mandatory on Windows) */
 int pa_lock_fd(int fd, int b) {
 #ifdef F_SETLKW
-    struct flock flock;
+    struct flock f_lock;
 
     /* Try a R/W lock first */
 
-    flock.l_type = (short) (b ? F_WRLCK : F_UNLCK);
-    flock.l_whence = SEEK_SET;
-    flock.l_start = 0;
-    flock.l_len = 0;
+    f_lock.l_type = (short) (b ? F_WRLCK : F_UNLCK);
+    f_lock.l_whence = SEEK_SET;
+    f_lock.l_start = 0;
+    f_lock.l_len = 0;
 
-    if (fcntl(fd, F_SETLKW, &flock) >= 0)
+    if (fcntl(fd, F_SETLKW, &f_lock) >= 0)
         return 0;
 
     /* Perhaps the file descriptor qas opened for read only, than try again with a read lock. */
     if (b && errno == EBADF) {
-        flock.l_type = F_RDLCK;
-        if (fcntl(fd, F_SETLKW, &flock) >= 0)
+        f_lock.l_type = F_RDLCK;
+        if (fcntl(fd, F_SETLKW, &f_lock) >= 0)
             return 0;
     }
 

commit 1ca76031092ab07682843fd70607696f6af7216f
Author: Diego Elio 'Flameeyes' Pettenò <flameeyes at gmail.com>
Date:   Thu Jun 25 12:39:09 2009 +0200

    Add missing headers includes for FreeBSD.
    
    This removes the implicit declarations of send() and pthread_sigmask().

diff --git a/src/pulse/thread-mainloop.c b/src/pulse/thread-mainloop.c
index c77cc64..6916d86 100644
--- a/src/pulse/thread-mainloop.c
+++ b/src/pulse/thread-mainloop.c
@@ -24,6 +24,10 @@
 #include <config.h>
 #endif
 
+#ifndef OS_IS_WIN32
+#include <pthread.h>
+#endif
+
 #include <signal.h>
 #include <stdio.h>
 
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 9511142..04e7eb2 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -43,6 +43,7 @@
 #include <regex.h>
 #include <langinfo.h>
 #include <sys/utsname.h>
+#include <sys/socket.h>
 
 #ifdef HAVE_STRTOF_L
 #include <locale.h>

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list