[pulseaudio-commits] 8 commits - configure.ac libpulse-browse.pc.in m4/orc.m4 Makefile.am man/Makefile.am man/pabrowse.1.xml.in po/POTFILES.in src/daemon src/.gitignore src/Makefile.am src/map-file src/modules src/pulse src/pulsecore src/tests src/utils todo

Colin Guthrie colin at kemper.freedesktop.org
Fri Jun 24 02:38:33 PDT 2011


 Makefile.am                             |    5 
 configure.ac                            |    1 
 libpulse-browse.pc.in                   |   12 
 m4/orc.m4                               |   21 +
 man/Makefile.am                         |    3 
 man/pabrowse.1.xml.in                   |   47 ---
 po/POTFILES.in                          |    2 
 src/.gitignore                          |    1 
 src/Makefile.am                         |   89 ------
 src/daemon/daemon-conf.c                |   11 
 src/daemon/main.c                       |    2 
 src/map-file                            |    6 
 src/modules/module-augment-properties.c |    2 
 src/modules/module-cli.c                |    2 
 src/modules/module-null-sink.c          |    3 
 src/modules/raop/module-raop-discover.c |    2 
 src/modules/raop/module-raop-sink.c     |    8 
 src/pulse/browser.c                     |  464 --------------------------------
 src/pulse/browser.h                     |   99 ------
 src/pulse/rtclock.c                     |    3 
 src/pulse/stream.c                      |    9 
 src/pulse/timeval.c                     |    2 
 src/pulse/util.c                        |    4 
 src/pulsecore/arpa-inet.c               |    1 
 src/pulsecore/cli-command.c             |    4 
 src/pulsecore/core-util.c               |   21 -
 src/pulsecore/dllmain.c                 |    2 
 src/pulsecore/random.c                  |    4 
 src/pulsecore/shm.c                     |    2 
 src/pulsecore/socket-util.c             |    8 
 src/pulsecore/start-child.c             |    4 
 src/pulsecore/thread-win32.c            |   21 +
 src/tests/once-test.c                   |   10 
 src/tests/thread-test.c                 |    2 
 src/utils/pabrowse.c                    |  156 ----------
 todo                                    |   18 -
 36 files changed, 123 insertions(+), 928 deletions(-)

New commits:
commit f04331fa152995330d623de14d59771084c688e3
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Thu Jun 23 22:21:06 2011 +0200

    build-sys: Update orc.m4 to latest upstream version
    
    ORCC is now correctly set to orcc on build system instead of host for cross-compiling

diff --git a/m4/orc.m4 b/m4/orc.m4
index 92bf21e..983d462 100644
--- a/m4/orc.m4
+++ b/m4/orc.m4
@@ -5,7 +5,7 @@ dnl ORC_CHECK([REQUIRED_VERSION])
 
 AC_DEFUN([ORC_CHECK],
 [
-  ORC_REQ=ifelse([$1], , "0.4.5", [$1])
+  ORC_REQ=ifelse([$1], , "0.4.6", [$1])
 
   AC_ARG_ENABLE(orc,
   AC_HELP_STRING([--enable-orc],[use Orc if installed]),
@@ -21,21 +21,34 @@ AC_DEFUN([ORC_CHECK],
   if test "x$enable_orc" != "xno" ; then
     PKG_CHECK_MODULES(ORC, orc-0.4 >= $ORC_REQ, [
       AC_DEFINE(HAVE_ORC, 1, [Use Orc])
-      ORCC=`$PKG_CONFIG --variable=orcc orc-0.4`
-      AC_SUBST(ORCC)
       HAVE_ORC=yes
+      if test "x$ORCC" = "x" ; then
+        AC_MSG_CHECKING(for usable orcc)
+        ORCC=`$PKG_CONFIG --variable=orcc orc-0.4`
+        dnl check whether the orcc found by pkg-config can be run from the build environment
+        dnl if this is not the case (e.g. when cross-compiling) fall back to orcc from PATH
+        AS_IF([$ORCC --version 1> /dev/null 2> /dev/null], [], [ORCC=`which orcc`])
+        AC_MSG_RESULT($ORCC)
+      fi
+      AC_SUBST(ORCC)
+      ORCC_FLAGS="--compat $ORC_REQ"
+      AC_SUBST(ORCC_FLAGS)
+      AS_IF([test "x$ORCC" = "x"], [HAVE_ORCC=no], [HAVE_ORCC=yes])
     ], [
       if test "x$enable_orc" = "xyes" ; then
         AC_MSG_ERROR([--enable-orc specified, but Orc >= $ORC_REQ not found])
       fi
       AC_DEFINE(DISABLE_ORC, 1, [Disable Orc])
       HAVE_ORC=no
+      HAVE_ORCC=no
     ])
   else
     AC_DEFINE(DISABLE_ORC, 1, [Disable Orc])
     HAVE_ORC=no
+    HAVE_ORCC=no
   fi
-  AM_CONDITIONAL(HAVE_ORC, test "x$HAVE_ORC" = "xyes")
+  AM_CONDITIONAL(HAVE_ORC, [test "x$HAVE_ORC" = "xyes"])
+  AM_CONDITIONAL(HAVE_ORCC, [test "x$HAVE_ORCC" = "xyes"])
 
 ]))
 

commit ebf93404b6c453ef27f4d35b04f1e08ba90732df
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Thu Jun 23 22:21:05 2011 +0200

    Remove libpulse-browse and pabrowse

diff --git a/Makefile.am b/Makefile.am
index 5e3b627..b010701 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,11 +46,6 @@ vapi_DATA = \
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libpulse.pc libpulse-simple.pc
 
-if HAVE_AVAHI
-pkgconfig_DATA += \
-	 libpulse-browse.pc
-endif
-
 if HAVE_GLIB20
 pkgconfig_DATA += \
 	 libpulse-mainloop-glib.pc
diff --git a/configure.ac b/configure.ac
index 163c561..458c184 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1195,7 +1195,6 @@ src/Makefile
 man/Makefile
 libpulse.pc
 libpulse-simple.pc
-libpulse-browse.pc
 libpulse-mainloop-glib.pc
 doxygen/Makefile
 doxygen/doxygen.conf
diff --git a/libpulse-browse.pc.in b/libpulse-browse.pc.in
deleted file mode 100644
index 4346168..0000000
--- a/libpulse-browse.pc.in
+++ /dev/null
@@ -1,12 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: libpulse-browse
-Description: PulseAudio Network Browsing Interface
-Version: @PACKAGE_VERSION@
-Libs: -L${libdir} -lpulse-browse @PTHREAD_LIBS@
-Libs.private: -lpulsecommon- at PA_MAJORMINOR@
-Cflags: -I${includedir} -D_REENTRANT
-Requires: libpulse
diff --git a/man/Makefile.am b/man/Makefile.am
index eca1fb9..8457e03 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -30,7 +30,6 @@ noinst_DATA = \
 	pactl.1.xml \
 	pasuspender.1.xml \
 	padsp.1.xml \
-	pabrowse.1.xml \
 	pulse-daemon.conf.5.xml \
 	pulse-client.conf.5.xml \
 	default.pa.5.xml
@@ -57,7 +56,6 @@ dist_man_MANS = \
 	pactl.1 \
 	pasuspender.1 \
 	padsp.1 \
-	pabrowse.1 \
 	pulse-daemon.conf.5 \
 	pulse-client.conf.5 \
 	default.pa.5
@@ -80,7 +78,6 @@ EXTRA_DIST = \
 	pactl.1.xml.in \
 	pasuspender.1.xml.in \
 	padsp.1.xml.in \
-	pabrowse.1.xml.in \
 	pulse-daemon.conf.5.xml.in \
 	pulse-client.conf.5.xml.in \
 	default.pa.5.xml.in \
diff --git a/man/pabrowse.1.xml.in b/man/pabrowse.1.xml.in
deleted file mode 100644
index 33f071b..0000000
--- a/man/pabrowse.1.xml.in
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0"?><!--*-nxml-*-->
-<!DOCTYPE manpage SYSTEM "xmltoman.dtd">
-<?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
-
-<!--
-This file is part of PulseAudio.
-
-PulseAudio is free software; you can redistribute it and/or modify it
-under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of the
-License, or (at your option) any later version.
-
-PulseAudio is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
-Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with PulseAudio; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-USA.
--->
-
-<manpage name="pabrowse" section="1" desc="List PulseAudio sound servers on the network">
-
-  <synopsis>
-    <cmd>pabrowse</cmd>
-  </synopsis>
-
-  <description>
-    <p><file>pabrowse</file> lists all PulseAudio sound servers on the
-    local network that are being announced with Zeroconf/Avahi.</p>
-
-    <p>This program takes no command line arguments.</p>
-  </description>
-
-  <section name="Authors">
-    <p>The PulseAudio Developers &lt;@PACKAGE_BUGREPORT@&gt;; PulseAudio is available from <url href="@PACKAGE_URL@"/></p>
-  </section>
-
-  <section name="See also">
-    <p>
-      <manref name="pulseaudio" section="1"/>, <manref name="avahi-daemon" section="8"/>
-    </p>
-  </section>
-
-</manpage>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index db5a940..f893655 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -164,7 +164,6 @@ src/pulse/mainloop-api.c
 src/pulse/sample.c
 src/pulse/client-conf-x11.c
 src/pulse/client-conf.c
-src/pulse/browser.c
 src/pulse/volume.c
 src/pulse/simple.c
 src/pulse/subscribe.c
@@ -180,7 +179,6 @@ src/pulse/timeval.c
 src/pulse/format.c
 src/utils/pacat.c
 src/utils/pasuspender.c
-src/utils/pabrowse.c
 src/utils/pactl.c
 src/utils/padsp.c
 src/utils/pax11publish.c
diff --git a/src/.gitignore b/src/.gitignore
index 554176b..072a75c 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -37,7 +37,6 @@ mcalign-test
 memblock-test
 memblockq-test
 mix-test
-pabrowse
 pacat
 pacat-simple
 pacmd
diff --git a/src/Makefile.am b/src/Makefile.am
index a0e7ce3..a37e202 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -203,10 +203,6 @@ bin_PROGRAMS += pax11publish
 bin_SCRIPTS += start-pulseaudio-x11 start-pulseaudio-kde
 endif
 
-if HAVE_AVAHI
-bin_PROGRAMS += pabrowse
-endif
-
 pacat_SOURCES = utils/pacat.c
 pacat_LDADD = $(AM_LDADD) libpulse.la libpulsecommon- at PA_MAJORMINOR@.la $(LIBSNDFILE_LIBS)
 pacat_CFLAGS = $(AM_CFLAGS) $(LIBSNDFILE_CFLAGS)
@@ -232,11 +228,6 @@ pax11publish_CFLAGS = $(AM_CFLAGS) $(X11_CFLAGS)
 pax11publish_LDADD = $(AM_LDADD) libpulse.la libpulsecommon- at PA_MAJORMINOR@.la $(X11_LIBS)
 pax11publish_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
 
-pabrowse_SOURCES = utils/pabrowse.c
-pabrowse_LDADD = $(AM_LDADD) libpulse.la libpulse-browse.la libpulsecommon- at PA_MAJORMINOR@.la
-pabrowse_CFLAGS = $(AM_CFLAGS)
-pabrowse_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
-
 ###################################
 #         Test programs           #
 ###################################
@@ -716,14 +707,6 @@ lib_LTLIBRARIES += \
 		libpulse.la \
 		libpulse-simple.la
 
-if HAVE_AVAHI
-pulseinclude_HEADERS += \
-		pulse/browser.h
-
-lib_LTLIBRARIES += \
-		libpulse-browse.la
-endif
-
 if HAVE_GLIB20
 pulseinclude_HEADERS += \
 		pulse/glib-mainloop.h
@@ -777,11 +760,6 @@ libpulse_simple_la_CFLAGS = $(AM_CFLAGS)
 libpulse_simple_la_LIBADD = $(AM_LIBADD) libpulse.la libpulsecommon- at PA_MAJORMINOR@.la
 libpulse_simple_la_LDFLAGS = $(AM_LDFLAGS) $(VERSIONING_LDFLAGS) -version-info $(LIBPULSE_SIMPLE_VERSION_INFO)
 
-libpulse_browse_la_SOURCES = pulse/browser.c pulse/browser.h pulsecore/avahi-wrap.c pulsecore/avahi-wrap.h
-libpulse_browse_la_CFLAGS = $(AM_CFLAGS) $(AVAHI_CFLAGS)
-libpulse_browse_la_LIBADD = $(AM_LIBADD) libpulse.la libpulsecommon- at PA_MAJORMINOR@.la $(AVAHI_LIBS)
-libpulse_browse_la_LDFLAGS = $(AM_LDFLAGS) $(VERSIONING_LDFLAGS) -version-info $(LIBPULSE_BROWSE_VERSION_INFO)
-
 libpulse_mainloop_glib_la_SOURCES = pulse/glib-mainloop.h pulse/glib-mainloop.c
 libpulse_mainloop_glib_la_CFLAGS = $(AM_CFLAGS) $(GLIB20_CFLAGS)
 libpulse_mainloop_glib_la_LIBADD = $(AM_LIBADD) libpulse.la libpulsecommon- at PA_MAJORMINOR@.la $(GLIB20_LIBS)
diff --git a/src/map-file b/src/map-file
index 31ef271..d9c3e9f 100644
--- a/src/map-file
+++ b/src/map-file
@@ -2,12 +2,6 @@ PULSE_0 {
 global:
 pa_ascii_filter;
 pa_ascii_valid;
-pa_browser_new;
-pa_browser_new_full;
-pa_browser_ref;
-pa_browser_set_callback;
-pa_browser_set_error_callback;
-pa_browser_unref;
 pa_bytes_per_second;
 pa_bytes_snprint;
 pa_bytes_to_usec;
diff --git a/src/pulse/browser.c b/src/pulse/browser.c
deleted file mode 100644
index d059228..0000000
--- a/src/pulse/browser.c
+++ /dev/null
@@ -1,464 +0,0 @@
-/***
-  This file is part of PulseAudio.
-
-  Copyright 2004-2006 Lennart Poettering
-
-  PulseAudio is free software; you can redistribute it and/or modify
-  it under the terms of the GNU Lesser General Public License as
-  published by the Free Software Foundation; either version 2.1 of the
-  License, or (at your option) any later version.
-
-  PulseAudio is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with PulseAudio; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-  USA.
-***/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string.h>
-
-#include <avahi-client/lookup.h>
-#include <avahi-common/domain.h>
-#include <avahi-common/error.h>
-
-#include <pulse/xmalloc.h>
-
-#include <pulsecore/log.h>
-#include <pulsecore/core-util.h>
-#include <pulsecore/avahi-wrap.h>
-#include <pulsecore/refcnt.h>
-#include <pulsecore/macro.h>
-
-#include "browser.h"
-
-#define SERVICE_TYPE_SINK "_pulse-sink._tcp."
-#define SERVICE_TYPE_SOURCE "_pulse-source._tcp."
-#define SERVICE_TYPE_SERVER "_pulse-server._tcp."
-
-struct pa_browser {
-    PA_REFCNT_DECLARE;
-
-    pa_mainloop_api *mainloop;
-    AvahiPoll* avahi_poll;
-
-    pa_browse_cb_t callback;
-    void *userdata;
-
-    pa_browser_error_cb_t error_callback;
-    void *error_userdata;
-
-    AvahiClient *client;
-    AvahiServiceBrowser *server_browser, *sink_browser, *source_browser;
-
-};
-
-static int map_to_opcode(const char *type, int new) {
-
-    if (avahi_domain_equal(type, SERVICE_TYPE_SINK))
-        return new ? PA_BROWSE_NEW_SINK : PA_BROWSE_REMOVE_SINK;
-    else if (avahi_domain_equal(type, SERVICE_TYPE_SOURCE))
-        return new ? PA_BROWSE_NEW_SOURCE : PA_BROWSE_REMOVE_SOURCE;
-    else if (avahi_domain_equal(type, SERVICE_TYPE_SERVER))
-        return new ? PA_BROWSE_NEW_SERVER : PA_BROWSE_REMOVE_SERVER;
-
-    return -1;
-}
-
-static void resolve_callback(
-        AvahiServiceResolver *r,
-        AvahiIfIndex interface,
-        AvahiProtocol protocol,
-        AvahiResolverEvent event,
-        const char *name,
-        const char *type,
-        const char *domain,
-        const char *host_name,
-        const AvahiAddress *aa,
-        uint16_t port,
-        AvahiStringList *txt,
-        AvahiLookupResultFlags flags,
-        void *userdata) {
-
-    pa_browser *b = userdata;
-    pa_browse_info i;
-    char ip[256], a[256];
-    int opcode;
-    int device_found = 0;
-    uint32_t cookie;
-    pa_sample_spec ss;
-    int ss_valid = 0;
-    char *key = NULL, *value = NULL;
-
-    pa_assert(b);
-    pa_assert(PA_REFCNT_VALUE(b) >= 1);
-
-    memset(&i, 0, sizeof(i));
-    i.name = name;
-
-    if (event != AVAHI_RESOLVER_FOUND)
-        goto fail;
-
-    if (!b->callback)
-        goto fail;
-
-    opcode = map_to_opcode(type, 1);
-    pa_assert(opcode >= 0);
-
-    if (aa->proto == AVAHI_PROTO_INET)
-        pa_snprintf(a, sizeof(a), "tcp:%s:%u", avahi_address_snprint(ip, sizeof(ip), aa), port);
-    else {
-        pa_assert(aa->proto == AVAHI_PROTO_INET6);
-        pa_snprintf(a, sizeof(a), "tcp6:%s:%u", avahi_address_snprint(ip, sizeof(ip), aa), port);
-    }
-    i.server = a;
-
-
-    while (txt) {
-
-        if (avahi_string_list_get_pair(txt, &key, &value, NULL) < 0)
-            break;
-
-        if (!strcmp(key, "device")) {
-            device_found = 1;
-            pa_xfree((char*) i.device);
-            i.device = value;
-            value = NULL;
-        } else if (!strcmp(key, "server-version")) {
-            pa_xfree((char*) i.server_version);
-            i.server_version = value;
-            value = NULL;
-        } else if (!strcmp(key, "user-name")) {
-            pa_xfree((char*) i.user_name);
-            i.user_name = value;
-            value = NULL;
-        } else if (!strcmp(key, "fqdn")) {
-            size_t l;
-
-            pa_xfree((char*) i.fqdn);
-            i.fqdn = value;
-            value = NULL;
-
-            l = strlen(a);
-            pa_assert(l+1 <= sizeof(a));
-            strncat(a, " ", sizeof(a)-l-1);
-            strncat(a, i.fqdn, sizeof(a)-l-2);
-        } else if (!strcmp(key, "cookie")) {
-
-            if (pa_atou(value, &cookie) < 0)
-                goto fail;
-
-            i.cookie = &cookie;
-        } else if (!strcmp(key, "description")) {
-            pa_xfree((char*) i.description);
-            i.description = value;
-            value = NULL;
-        } else if (!strcmp(key, "channels")) {
-            uint32_t ch;
-
-            if (pa_atou(value, &ch) < 0 || ch <= 0 || ch > 255)
-                goto fail;
-
-            ss.channels = (uint8_t) ch;
-            ss_valid |= 1;
-
-        } else if (!strcmp(key, "rate")) {
-            if (pa_atou(value, &ss.rate) < 0)
-                goto fail;
-            ss_valid |= 2;
-        } else if (!strcmp(key, "format")) {
-
-            if ((ss.format = pa_parse_sample_format(value)) == PA_SAMPLE_INVALID)
-                goto fail;
-
-            ss_valid |= 4;
-        }
-
-        pa_xfree(key);
-        pa_xfree(value);
-        key = value = NULL;
-
-        txt = avahi_string_list_get_next(txt);
-    }
-
-    /* No device txt record was sent for a sink or source service */
-    if (opcode != PA_BROWSE_NEW_SERVER && !device_found)
-        goto fail;
-
-    if (ss_valid == 7)
-        i.sample_spec = &ss;
-
-    b->callback(b, opcode, &i, b->userdata);
-
-fail:
-    pa_xfree((void*) i.device);
-    pa_xfree((void*) i.fqdn);
-    pa_xfree((void*) i.server_version);
-    pa_xfree((void*) i.user_name);
-    pa_xfree((void*) i.description);
-
-    pa_xfree(key);
-    pa_xfree(value);
-
-    avahi_service_resolver_free(r);
-}
-
-static void handle_failure(pa_browser *b) {
-    const char *e = NULL;
-
-    pa_assert(b);
-    pa_assert(PA_REFCNT_VALUE(b) >= 1);
-
-    if (b->sink_browser)
-        avahi_service_browser_free(b->sink_browser);
-    if (b->source_browser)
-        avahi_service_browser_free(b->source_browser);
-    if (b->server_browser)
-        avahi_service_browser_free(b->server_browser);
-
-    b->sink_browser = b->source_browser = b->server_browser = NULL;
-
-    if (b->client) {
-        e = avahi_strerror(avahi_client_errno(b->client));
-        avahi_client_free(b->client);
-    }
-
-    b->client = NULL;
-
-    if (b->error_callback)
-        b->error_callback(b, e, b->error_userdata);
-}
-
-static void browse_callback(
-        AvahiServiceBrowser *sb,
-        AvahiIfIndex interface,
-        AvahiProtocol protocol,
-        AvahiBrowserEvent event,
-        const char *name,
-        const char *type,
-        const char *domain,
-        AvahiLookupResultFlags flags,
-        void *userdata) {
-
-    pa_browser *b = userdata;
-
-    pa_assert(b);
-    pa_assert(PA_REFCNT_VALUE(b) >= 1);
-
-    switch (event) {
-        case AVAHI_BROWSER_NEW: {
-
-            if (!avahi_service_resolver_new(
-                          b->client,
-                          interface,
-                          protocol,
-                          name,
-                          type,
-                          domain,
-                          AVAHI_PROTO_UNSPEC,
-                          0,
-                          resolve_callback,
-                          b))
-                handle_failure(b);
-
-            break;
-        }
-
-        case AVAHI_BROWSER_REMOVE: {
-
-            if (b->callback) {
-                pa_browse_info i;
-                int opcode;
-
-                memset(&i, 0, sizeof(i));
-                i.name = name;
-
-                opcode = map_to_opcode(type, 0);
-                pa_assert(opcode >= 0);
-
-                b->callback(b, opcode, &i, b->userdata);
-            }
-            break;
-        }
-
-        case AVAHI_BROWSER_FAILURE: {
-            handle_failure(b);
-            break;
-        }
-
-        default:
-            ;
-    }
-}
-
-static void client_callback(AvahiClient *s, AvahiClientState state, void *userdata) {
-    pa_browser *b = userdata;
-
-    pa_assert(s);
-    pa_assert(b);
-    pa_assert(PA_REFCNT_VALUE(b) >= 1);
-
-    if (state == AVAHI_CLIENT_FAILURE)
-        handle_failure(b);
-}
-
-static void browser_free(pa_browser *b);
-
-
-PA_WARN_REFERENCE(pa_browser_new, "libpulse-browse is being phased out.");
-
-pa_browser *pa_browser_new(pa_mainloop_api *mainloop) {
-    return pa_browser_new_full(mainloop, PA_BROWSE_FOR_SERVERS|PA_BROWSE_FOR_SINKS|PA_BROWSE_FOR_SOURCES, NULL);
-}
-
-PA_WARN_REFERENCE(pa_browser_new_full, "libpulse-browse is being phased out.");
-
-pa_browser *pa_browser_new_full(pa_mainloop_api *mainloop, pa_browse_flags_t flags, const char **error_string) {
-    pa_browser *b;
-    int error;
-
-    pa_assert(mainloop);
-
-    if (flags & ~(PA_BROWSE_FOR_SERVERS|PA_BROWSE_FOR_SINKS|PA_BROWSE_FOR_SOURCES) || flags == 0)
-        return NULL;
-
-    b = pa_xnew(pa_browser, 1);
-    b->mainloop = mainloop;
-    PA_REFCNT_INIT(b);
-    b->callback = NULL;
-    b->userdata = NULL;
-    b->error_callback = NULL;
-    b->error_userdata = NULL;
-    b->sink_browser = b->source_browser = b->server_browser = NULL;
-
-    b->avahi_poll = pa_avahi_poll_new(mainloop);
-
-    if (!(b->client = avahi_client_new(b->avahi_poll, 0, client_callback, b, &error))) {
-        if (error_string)
-            *error_string = avahi_strerror(error);
-        goto fail;
-    }
-
-    if ((flags & PA_BROWSE_FOR_SERVERS) &&
-        !(b->server_browser = avahi_service_browser_new(
-                  b->client,
-                  AVAHI_IF_UNSPEC,
-                  AVAHI_PROTO_INET,
-                  SERVICE_TYPE_SERVER,
-                  NULL,
-                  0,
-                  browse_callback,
-                  b))) {
-
-        if (error_string)
-            *error_string = avahi_strerror(avahi_client_errno(b->client));
-        goto fail;
-    }
-
-    if ((flags & PA_BROWSE_FOR_SINKS) &&
-        !(b->sink_browser = avahi_service_browser_new(
-                  b->client,
-                  AVAHI_IF_UNSPEC,
-                  AVAHI_PROTO_UNSPEC,
-                  SERVICE_TYPE_SINK,
-                  NULL,
-                  0,
-                  browse_callback,
-                  b))) {
-
-        if (error_string)
-            *error_string = avahi_strerror(avahi_client_errno(b->client));
-        goto fail;
-    }
-
-    if ((flags & PA_BROWSE_FOR_SOURCES) &&
-        !(b->source_browser = avahi_service_browser_new(
-                  b->client,
-                  AVAHI_IF_UNSPEC,
-                  AVAHI_PROTO_UNSPEC,
-                  SERVICE_TYPE_SOURCE,
-                  NULL,
-                  0,
-                  browse_callback,
-                  b))) {
-
-        if (error_string)
-            *error_string = avahi_strerror(avahi_client_errno(b->client));
-        goto fail;
-    }
-
-    return b;
-
-fail:
-    if (b)
-        browser_free(b);
-
-    return NULL;
-}
-
-static void browser_free(pa_browser *b) {
-    pa_assert(b);
-    pa_assert(b->mainloop);
-
-    if (b->sink_browser)
-        avahi_service_browser_free(b->sink_browser);
-    if (b->source_browser)
-        avahi_service_browser_free(b->source_browser);
-    if (b->server_browser)
-        avahi_service_browser_free(b->server_browser);
-
-    if (b->client)
-        avahi_client_free(b->client);
-
-    if (b->avahi_poll)
-        pa_avahi_poll_free(b->avahi_poll);
-
-    pa_xfree(b);
-}
-
-PA_WARN_REFERENCE(pa_browser_ref, "libpulse-browse is being phased out.");
-
-pa_browser *pa_browser_ref(pa_browser *b) {
-    pa_assert(b);
-    pa_assert(PA_REFCNT_VALUE(b) >= 1);
-
-    PA_REFCNT_INC(b);
-    return b;
-}
-
-PA_WARN_REFERENCE(pa_browser_unref, "libpulse-browse is being phased out.");
-
-void pa_browser_unref(pa_browser *b) {
-    pa_assert(b);
-    pa_assert(PA_REFCNT_VALUE(b) >= 1);
-
-    if (PA_REFCNT_DEC(b) <= 0)
-        browser_free(b);
-}
-
-PA_WARN_REFERENCE(pa_browser_set_callback, "libpulse-browse is being phased out.");
-
-void pa_browser_set_callback(pa_browser *b, pa_browse_cb_t cb, void *userdata) {
-    pa_assert(b);
-    pa_assert(PA_REFCNT_VALUE(b) >= 1);
-
-    b->callback = cb;
-    b->userdata = userdata;
-}
-
-PA_WARN_REFERENCE(pa_browser_set_error_callback, "libpulse-browse is being phased out.");
-
-void pa_browser_set_error_callback(pa_browser *b, pa_browser_error_cb_t cb, void *userdata) {
-    pa_assert(b);
-    pa_assert(PA_REFCNT_VALUE(b) >= 1);
-
-    b->error_callback = cb;
-    b->error_userdata = userdata;
-}
diff --git a/src/pulse/browser.h b/src/pulse/browser.h
deleted file mode 100644
index c843e2a..0000000
--- a/src/pulse/browser.h
+++ /dev/null
@@ -1,99 +0,0 @@
-#ifndef foobrowserhfoo
-#define foobrowserhfoo
-
-/***
-  This file is part of PulseAudio.
-
-  Copyright 2004-2006 Lennart Poettering
-
-  PulseAudio is free software; you can redistribute it and/or modify
-  it under the terms of the GNU Lesser General Public License as
-  published by the Free Software Foundation; either version 2.1 of the
-  License, or (at your option) any later version.
-
-  PulseAudio is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with PulseAudio; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-  USA.
-***/
-
-#include <pulse/mainloop-api.h>
-#include <pulse/sample.h>
-#include <pulse/channelmap.h>
-#include <pulse/cdecl.h>
-#include <pulse/version.h>
-
-/** \file
- * An abstract interface for Zeroconf browsing of PulseAudio servers */
-
-PA_C_DECL_BEGIN
-
-/** An opaque Zeroconf service browser object */
-typedef struct pa_browser pa_browser;
-
-/** Opcodes for pa_browser_cb_t callbacks */
-typedef enum pa_browse_opcode {
-    PA_BROWSE_NEW_SERVER = 0, /**< New server found */
-    PA_BROWSE_NEW_SINK,       /**< New sink found */
-    PA_BROWSE_NEW_SOURCE,     /**< New source found */
-    PA_BROWSE_REMOVE_SERVER,  /**< Server disappeared */
-    PA_BROWSE_REMOVE_SINK,    /**< Sink disappeared */
-    PA_BROWSE_REMOVE_SOURCE   /**< Source disappeared */
-} pa_browse_opcode_t;
-
-typedef enum pa_browse_flags {
-    PA_BROWSE_FOR_SERVERS = 1, /**< Browse for servers */
-    PA_BROWSE_FOR_SINKS = 2, /**< Browse for sinks */
-    PA_BROWSE_FOR_SOURCES = 4 /** Browse for sources */
-} pa_browse_flags_t;
-
-/** Create a new browser object on the specified main loop */
-pa_browser *pa_browser_new(pa_mainloop_api *mainloop);
-
-/** Same pa_browser_new, but pass additional flags parameter. */
-pa_browser *pa_browser_new_full(pa_mainloop_api *mainloop, pa_browse_flags_t flags, const char **error_string);
-
-/** Increase reference counter of the specified browser object */
-pa_browser *pa_browser_ref(pa_browser *z);
-
-/** Decrease reference counter of the specified browser object */
-void pa_browser_unref(pa_browser *z);
-
-/** Information about a sink/source/server found with Zeroconf */
-typedef struct pa_browse_info {
-    const char *name;  /**< Unique service name; always available */
-
-    const char *server; /**< Server name; always available */
-    const char *server_version; /**< Server version string; optional */
-    const char *user_name; /**< User name of the server process; optional */
-    const char *fqdn; /* Server version; optional */
-    const uint32_t *cookie;  /* Server cookie; optional */
-
-    const char *device; /* Device name; always available when this information is of a sink/source */
-    const char *description;  /* Device description; optional */
-    const pa_sample_spec *sample_spec;  /* Sample specification of the device; optional */
-} pa_browse_info;
-
-/** Callback prototype */
-typedef void (*pa_browse_cb_t)(pa_browser *z, pa_browse_opcode_t c, const pa_browse_info *i, void *userdata);
-
-/** Set the callback pointer for the browser object */
-void pa_browser_set_callback(pa_browser *z, pa_browse_cb_t cb, void *userdata);
-
-/** Callback prototype for errors */
-typedef void (*pa_browser_error_cb_t)(pa_browser *z, const char *error_string, void *userdata);
-
-/** Set a callback function that is called whenever the browser object
- * becomes invalid due to an error. After this function has been
- * called the browser object has become invalid and should be
- * freed. */
-void pa_browser_set_error_callback(pa_browser *z, pa_browser_error_cb_t, void *userdata);
-
-PA_C_DECL_END
-
-#endif
diff --git a/src/utils/pabrowse.c b/src/utils/pabrowse.c
deleted file mode 100644
index a00fb4d..0000000
--- a/src/utils/pabrowse.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/***
-  This file is part of PulseAudio.
-
-  Copyright 2004-2006 Lennart Poettering
-
-  PulseAudio is free software; you can redistribute it and/or modify
-  it under the terms of the GNU Lesser General Public License as published
-  by the Free Software Foundation; either version 2.1 of the License,
-  or (at your option) any later version.
-
-  PulseAudio is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with PulseAudio; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-  USA.
-***/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <assert.h>
-#include <signal.h>
-
-#include <pulse/browser.h>
-#include <pulse/pulseaudio.h>
-
-#include <pulsecore/core-util.h>
-
-static void exit_signal_callback(pa_mainloop_api*m, pa_signal_event *e, int sig, void *userdata) {
-    fprintf(stderr, "Got signal, exiting\n");
-    m->quit(m, 0);
-}
-
-static void dump_server(const pa_browse_info *i) {
-    char t[16];
-
-    if (i->cookie)
-        snprintf(t, sizeof(t), "0x%08x", *i->cookie);
-
-    printf("server: %s\n"
-           "server-version: %s\n"
-           "user-name: %s\n"
-           "fqdn: %s\n"
-           "cookie: %s\n",
-           i->server,
-           i->server_version ? i->server_version : "n/a",
-           i->user_name ? i->user_name : "n/a",
-           i->fqdn ? i->fqdn : "n/a",
-           i->cookie ? t : "n/a");
-}
-
-static void dump_device(const pa_browse_info *i) {
-    char ss[PA_SAMPLE_SPEC_SNPRINT_MAX];
-
-    if (i->sample_spec)
-        pa_sample_spec_snprint(ss, sizeof(ss), i->sample_spec);
-
-    printf("device: %s\n"
-           "description: %s\n"
-           "sample spec: %s\n",
-           i->device,
-           i->description ? i->description : "n/a",
-           i->sample_spec ? ss : "n/a");
-
-}
-
-static void browser_callback(pa_browser *b, pa_browse_opcode_t c, const pa_browse_info *i, void *userdata) {
-    assert(b && i);
-
-    switch (c) {
-
-        case PA_BROWSE_NEW_SERVER:
-            printf("\n=> new server <%s>\n", i->name);
-            dump_server(i);
-            break;
-
-        case PA_BROWSE_NEW_SINK:
-            printf("\n=> new sink <%s>\n", i->name);
-            dump_server(i);
-            dump_device(i);
-            break;
-
-        case PA_BROWSE_NEW_SOURCE:
-            printf("\n=> new source <%s>\n", i->name);
-            dump_server(i);
-            dump_device(i);
-            break;
-
-        case PA_BROWSE_REMOVE_SERVER:
-            printf("\n=> removed server <%s>\n", i->name);
-            break;
-
-        case PA_BROWSE_REMOVE_SINK:
-            printf("\n=> removed sink <%s>\n", i->name);
-            break;
-
-        case PA_BROWSE_REMOVE_SOURCE:
-            printf("\n=> removed source <%s>\n", i->name);
-            break;
-
-        default:
-            ;
-    }
-}
-
-static void error_callback(pa_browser *b, const char *s, void *userdata) {
-    pa_mainloop_api*m = userdata;
-
-    fprintf(stderr, "Failure: %s\n", s);
-    m->quit(m, 1);
-}
-
-int main(int argc, char *argv[]) {
-    pa_mainloop *mainloop = NULL;
-    pa_browser *browser = NULL;
-    int ret = 1, r;
-    const char *s;
-
-    if (!(mainloop = pa_mainloop_new()))
-        goto finish;
-
-    r = pa_signal_init(pa_mainloop_get_api(mainloop));
-    assert(r == 0);
-    pa_signal_new(SIGINT, exit_signal_callback, NULL);
-    pa_signal_new(SIGTERM, exit_signal_callback, NULL);
-    pa_disable_sigpipe();
-
-    if (!(browser = pa_browser_new_full(pa_mainloop_get_api(mainloop), PA_BROWSE_FOR_SERVERS|PA_BROWSE_FOR_SINKS|PA_BROWSE_FOR_SOURCES, &s))) {
-        fprintf(stderr, "pa_browse_new_full(): %s\n", s);
-        goto finish;
-    }
-
-    pa_browser_set_callback(browser, browser_callback, NULL);
-    pa_browser_set_error_callback(browser, error_callback, pa_mainloop_get_api(mainloop));
-
-    ret = 0;
-    pa_mainloop_run(mainloop, &ret);
-
-finish:
-
-    if (browser)
-        pa_browser_unref(browser);
-
-    if (mainloop) {
-        pa_signal_done();
-        pa_mainloop_free(mainloop);
-    }
-
-    return ret;
-}

commit 909d031134c60636c78aa9bc403fe53a29626ddd
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Thu Jun 23 22:21:04 2011 +0200

    Update todo

diff --git a/todo b/todo
index da993a2..653bedc 100644
--- a/todo
+++ b/todo
@@ -13,9 +13,12 @@ I18N:
 
 Cleanups:
 - drop dependency of libpulse on libX11, instead use an external mini binary
+
+Network:
 - module-tunnel: improve latency calculation
-- use software volume when hardware doesn't support all channels (alsa done)
-- using POSIX monotonous clocks wherever possible instead of gettimeofday()
+- module-tunnel: more reliable audio streaming over wifi
+- Compressed network streams for tunnels/rtp streams. (Might be a good GSoC project)
+  This builds on passthrough support. A good candidate codec would be CELT.
 
 Test:
 - autoload
@@ -27,19 +30,14 @@ Auth/Crypto:
 - sasl auth 
 
 Features:
-- chroot()
 - use scatter/gather io for sockets
-- CODECs to reduce bandwidth usage (plug-in based)
-- multiline configuration statements
-- paplay needs to set a channel map. our default is only correct for AIFF.
-  (we need help from libsndfile for this)
 - examine if it is possible to mimic esd's handling of half duplex cards
   (switch to capture when a recording client connects and drop playback during
   that time)
-- Support for device selection in waveout driver
 - add an API to libpulse for allocating memory from the pa_context memory pool
-- better ".include" command in configuration files. should have glob support.
-- recursive .if
+- configuration file syntax:
+  - multiline configuration statements
+  - recursive .if
 
 Long term:
 - pass meta info for hearing impaired

commit 5818a2c63e9a52a545b9c8eb6fdbfa24cfee822f
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Thu Jun 23 22:21:03 2011 +0200

    win32: Make some unused-variable warnings go away

diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c
index 67b772a..bb92909 100644
--- a/src/daemon/daemon-conf.c
+++ b/src/daemon/daemon-conf.c
@@ -470,6 +470,10 @@ static int parse_nice_level(const char *filename, unsigned line, const char *sec
 }
 
 static int parse_rtprio(const char *filename, unsigned line, const char *section, const char *lvalue, const char *rvalue, void *data, void *userdata) {
+#ifdef OS_IS_WIN32
+    pa_log("[%s:%u] Realtime priority not available on win32.", filename, line);
+#else
+# ifdef HAVE_SCHED_H
     pa_daemon_conf *c = data;
     int32_t rtprio;
 
@@ -478,16 +482,15 @@ static int parse_rtprio(const char *filename, unsigned line, const char *section
     pa_assert(rvalue);
     pa_assert(data);
 
-#ifndef OS_IS_WIN32
-# ifdef HAVE_SCHED_H
     if (pa_atoi(rvalue, &rtprio) < 0 || rtprio < sched_get_priority_min(SCHED_FIFO) || rtprio > sched_get_priority_max(SCHED_FIFO)) {
         pa_log("[%s:%u] Invalid realtime priority '%s'.", filename, line, rvalue);
         return -1;
     }
-# endif
-#endif
 
     c->realtime_priority = (int) rtprio;
+# endif
+#endif /* OS_IS_WIN32 */
+
     return 0;
 }
 
diff --git a/src/daemon/main.c b/src/daemon/main.c
index 90ed5ce..94c87d1 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -748,7 +748,9 @@ int main(int argc, char *argv[]) {
     }
 
     if (conf->daemonize) {
+#ifdef HAVE_FORK
         pid_t child;
+#endif
 
         if (pa_stdio_acquire() < 0) {
             pa_log(_("Failed to acquire stdio."));
diff --git a/src/modules/module-augment-properties.c b/src/modules/module-augment-properties.c
index bfc637a..05f6f0a 100644
--- a/src/modules/module-augment-properties.c
+++ b/src/modules/module-augment-properties.c
@@ -175,10 +175,10 @@ static void update_rule(struct rule *r) {
     if (stat(fn, &st) == 0)
         found = TRUE;
     else {
+#ifdef DT_DIR
         DIR *desktopfiles_dir;
         struct dirent *dir;
 
-#ifdef DT_DIR
         /* Let's try a more aggressive search, but only one level */
         if ((desktopfiles_dir = opendir(DESKTOPFILEDIR))) {
             while ((dir = readdir(desktopfiles_dir))) {
diff --git a/src/modules/module-cli.c b/src/modules/module-cli.c
index 7788a75..2a1d175 100644
--- a/src/modules/module-cli.c
+++ b/src/modules/module-cli.c
@@ -72,7 +72,9 @@ int pa__init(pa_module*m) {
     pa_iochannel *io;
     pa_modargs *ma;
     pa_bool_t exit_on_eof = FALSE;
+#ifndef OS_IS_WIN32
     int fd;
+#endif
 
     pa_assert(m);
 
diff --git a/src/pulse/stream.c b/src/pulse/stream.c
index d60b864..373bc34 100644
--- a/src/pulse/stream.c
+++ b/src/pulse/stream.c
@@ -790,11 +790,10 @@ void pa_command_stream_event(pa_pdispatch *pd, uint32_t command, uint32_t tag, p
         goto finish;
 
     if (pa_streq(event, PA_STREAM_EVENT_FORMAT_LOST)) {
-        /* Let client know what the running time was when the stream had to be
-         * killed  */
-        pa_usec_t time;
-        if (pa_stream_get_time(s, &time) == 0)
-            pa_proplist_setf(pl, "stream-time", "%llu", (unsigned long long) time);
+        /* Let client know what the running time was when the stream had to be killed  */
+        pa_usec_t stream_time;
+        if (pa_stream_get_time(s, &stream_time) == 0)
+            pa_proplist_setf(pl, "stream-time", "%llu", (unsigned long long) stream_time);
     }
 
     if (s->event_callback)
diff --git a/src/pulse/timeval.c b/src/pulse/timeval.c
index 10ba322..b405a70 100644
--- a/src/pulse/timeval.c
+++ b/src/pulse/timeval.c
@@ -49,6 +49,7 @@ struct timeval *pa_gettimeofday(struct timeval *tv) {
 #else
 #define EPOCHFILETIME (116444736000000000LL)
 #endif
+{
     FILETIME ft;
     LARGE_INTEGER li;
     int64_t t;
@@ -61,6 +62,7 @@ struct timeval *pa_gettimeofday(struct timeval *tv) {
     t /= 10;                /* In microseconds */
     tv->tv_sec  = (time_t) (t / PA_USEC_PER_SEC);
     tv->tv_usec = (suseconds_t) (t % PA_USEC_PER_SEC);
+}
 #elif defined(HAVE_GETTIMEOFDAY)
     pa_assert_se(gettimeofday(tv, NULL) == 0);
 #else
diff --git a/src/pulse/util.c b/src/pulse/util.c
index ba1d2a0..6656bc3 100644
--- a/src/pulse/util.c
+++ b/src/pulse/util.c
@@ -131,9 +131,9 @@ char *pa_get_host_name(char *s, size_t l) {
 }
 
 char *pa_get_home_dir(char *s, size_t l) {
-    char *e, *dir;
-
+    char *e;
 #ifdef HAVE_PWD_H
+    char *dir;
     struct passwd *r;
 #endif
 
diff --git a/src/pulsecore/arpa-inet.c b/src/pulsecore/arpa-inet.c
index c927ca0..09570bb 100644
--- a/src/pulsecore/arpa-inet.c
+++ b/src/pulsecore/arpa-inet.c
@@ -29,6 +29,7 @@
 
 #include <pulsecore/macro.h>
 #include <pulsecore/socket.h>
+#include <pulsecore/core-util.h>
 
 #include "arpa-inet.h"
 
diff --git a/src/pulsecore/cli-command.c b/src/pulsecore/cli-command.c
index e5c1806..16c7661 100644
--- a/src/pulsecore/cli-command.c
+++ b/src/pulsecore/cli-command.c
@@ -1574,8 +1574,10 @@ static int pa_cli_command_dump(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_b
     pa_card *card;
     pa_bool_t nl;
     uint32_t idx;
-    char txt[256];
     time_t now;
+#ifdef HAVE_CTIME_R
+    char txt[256];
+#endif
 
     pa_core_assert_ref(c);
     pa_assert(t);
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 6902ee9..f27f87a 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -219,7 +219,7 @@ void pa_make_fd_cloexec(int fd) {
 /** Creates a directory securely */
 int pa_make_secure_dir(const char* dir, mode_t m, uid_t uid, gid_t gid) {
     struct stat st;
-    int r, saved_errno, fd;
+    int r, saved_errno;
 
     pa_assert(dir);
 
@@ -238,6 +238,8 @@ int pa_make_secure_dir(const char* dir, mode_t m, uid_t uid, gid_t gid) {
         return -1;
 
 #if defined(HAVE_FSTAT) && !defined(OS_IS_WIN32)
+{
+    int fd;
     if ((fd = open(dir,
 #ifdef O_CLOEXEC
                    O_CLOEXEC|
@@ -276,6 +278,7 @@ int pa_make_secure_dir(const char* dir, mode_t m, uid_t uid, gid_t gid) {
 #endif
 
     pa_assert_se(pa_close(fd) >= 0);
+}
 #endif
 
 #ifdef HAVE_LSTAT
@@ -728,7 +731,7 @@ int pa_make_realtime(int rtprio) {
     pa_log_info("Successfully acquired real-time thread priority.");
     return 0;
 
-#elif _POSIX_PRIORITY_SCHEDULING
+#elif defined(_POSIX_PRIORITY_SCHEDULING)
     int p;
 
     if (set_scheduler(rtprio) >= 0) {
@@ -886,7 +889,6 @@ int pa_match(const char *expr, const char *v) {
 
 /* Try to parse a boolean string value.*/
 int pa_parse_boolean(const char *v) {
-    const char *expr;
     pa_assert(v);
 
     /* First we check language independant */
@@ -896,6 +898,8 @@ int pa_parse_boolean(const char *v) {
         return 0;
 
 #ifdef HAVE_LANGINFO_H
+{
+    const char *expr;
     /* And then we check language dependant */
     if ((expr = nl_langinfo(YESEXPR)))
         if (expr[0])
@@ -906,6 +910,7 @@ int pa_parse_boolean(const char *v) {
         if (expr[0])
             if (pa_match(expr, v) > 0)
                 return 0;
+}
 #endif
 
     errno = EINVAL;
@@ -1561,7 +1566,6 @@ static int make_random_dir_and_link(mode_t m, const char *k) {
 
 char *pa_get_runtime_dir(void) {
     char *d, *k = NULL, *p = NULL, *t = NULL, *mid;
-    struct stat st;
     mode_t m;
 
     /* The runtime directory shall contain dynamic data that needs NOT
@@ -1641,10 +1645,10 @@ char *pa_get_runtime_dir(void) {
             goto fail;
         }
 
-        /* Hmm, so this symlink is still around, make sure nobody fools
-         * us */
-
+        /* Hmm, so this symlink is still around, make sure nobody fools us */
 #ifdef HAVE_LSTAT
+{
+        struct stat st;
         if (lstat(p, &st) < 0) {
 
             if (errno != ENOENT) {
@@ -1664,6 +1668,7 @@ char *pa_get_runtime_dir(void) {
 
             pa_log_info("Hmm, runtime path exists, but points to an invalid directory. Changing runtime directory.");
         }
+}
 #endif
 
         pa_xfree(p);
@@ -2203,7 +2208,7 @@ void *pa_will_need(const void *p, size_t l) {
 #endif
     const void *a;
     size_t size;
-    int r;
+    int r = ENOTSUP;
     size_t bs;
 
     pa_assert(p);
diff --git a/src/pulsecore/dllmain.c b/src/pulsecore/dllmain.c
index 3ee8967..d2de73d 100644
--- a/src/pulsecore/dllmain.c
+++ b/src/pulsecore/dllmain.c
@@ -31,7 +31,7 @@
 #include <windows.h>
 #include <winsock2.h>
 
-extern pa_win32_get_toplevel(HANDLE handle);
+extern char *pa_win32_get_toplevel(HANDLE handle);
 
 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
     WSADATA data;
diff --git a/src/pulsecore/random.c b/src/pulsecore/random.c
index 1bd69c2..b2ec19f 100644
--- a/src/pulsecore/random.c
+++ b/src/pulsecore/random.c
@@ -49,11 +49,11 @@ static int random_proper(void *ret_data, size_t length) {
 #ifdef OS_IS_WIN32
     int ret = -1;
 
+    HCRYPTPROV hCryptProv = 0;
+
     pa_assert(ret_data);
     pa_assert(length > 0);
 
-    HCRYPTPROV hCryptProv = NULL;
-
     if (CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {
         if(CryptGenRandom(hCryptProv, length, ret_data))
             ret = 0;
diff --git a/src/pulsecore/shm.c b/src/pulsecore/shm.c
index da8aff7..442b698 100644
--- a/src/pulsecore/shm.c
+++ b/src/pulsecore/shm.c
@@ -98,8 +98,10 @@ static char *segment_name(char *fn, size_t l, unsigned id) {
 #endif
 
 int pa_shm_create_rw(pa_shm *m, size_t size, pa_bool_t shared, mode_t mode) {
+#ifdef HAVE_SHM_OPEN
     char fn[32];
     int fd = -1;
+#endif
 
     pa_assert(m);
     pa_assert(size > 0);
diff --git a/src/pulsecore/socket-util.c b/src/pulsecore/socket-util.c
index 46623c4..00fcbc4 100644
--- a/src/pulsecore/socket-util.c
+++ b/src/pulsecore/socket-util.c
@@ -72,8 +72,9 @@ void pa_socket_peer_to_string(int fd, char *c, size_t l) {
 #ifndef OS_IS_WIN32
     pa_assert_se(fstat(fd, &st) == 0);
 
-    if (S_ISSOCK(st.st_mode)) {
+    if (S_ISSOCK(st.st_mode))
 #endif
+    {
         union {
             struct sockaddr_storage storage;
             struct sockaddr sa;
@@ -118,10 +119,11 @@ void pa_socket_peer_to_string(int fd, char *c, size_t l) {
             }
         }
 
-#ifndef OS_IS_WIN32
         pa_snprintf(c, l, "Unknown network client");
         return;
-    } else if (S_ISCHR(st.st_mode) && (fd == 0 || fd == 1)) {
+    }
+#ifndef OS_IS_WIN32
+    else if (S_ISCHR(st.st_mode) && (fd == 0 || fd == 1)) {
         pa_snprintf(c, l, "STDIN/STDOUT client");
         return;
     }
diff --git a/src/pulsecore/start-child.c b/src/pulsecore/start-child.c
index fd1baeb..7f55d4e 100644
--- a/src/pulsecore/start-child.c
+++ b/src/pulsecore/start-child.c
@@ -45,10 +45,10 @@
 #include "start-child.h"
 
 int pa_start_child_for_read(const char *name, const char *argv1, pid_t *pid) {
+#ifdef HAVE_FORK
     pid_t child;
     int pipe_fds[2] = { -1, -1 };
 
-#ifdef HAVE_FORK
     if (pipe(pipe_fds) < 0) {
         pa_log("pipe() failed: %s", pa_cstrerror(errno));
         goto fail;
@@ -106,10 +106,10 @@ int pa_start_child_for_read(const char *name, const char *argv1, pid_t *pid) {
         execl(name, name, argv1, NULL);
         _exit(1);
     }
-#endif
 
 fail:
     pa_close_pipe(pipe_fds);
+#endif /* HAVE_FORK */
 
     return -1;
 }

commit 3adc43b8fe507e3140f7d6f9bab32584b9eadfa4
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Thu Jun 23 22:21:02 2011 +0200

    win32: Make once-test work
    
    The barrier is not used when pthread is not available.

diff --git a/src/Makefile.am b/src/Makefile.am
index 3858cb3..a0e7ce3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -271,6 +271,7 @@ TESTS = \
 
 TESTS_norun = \
 		mcalign-test \
+		once-test \
 		pacat-simple \
 		parec-simple \
 		extended-test \
@@ -309,13 +310,6 @@ TESTS_norun += \
 		alsa-time-test
 endif
 
-if !OS_IS_DARWIN
-if !OS_IS_WIN32
-TESTS_BINARIES += \
-		once-test
-endif
-endif
-
 if BUILD_TESTS_DEFAULT
 noinst_PROGRAMS = $(TESTS) $(TESTS_norun)
 else
diff --git a/src/pulsecore/thread-win32.c b/src/pulsecore/thread-win32.c
index e0839af..89c8c46 100644
--- a/src/pulsecore/thread-win32.c
+++ b/src/pulsecore/thread-win32.c
@@ -123,6 +123,27 @@ pa_thread* pa_thread_self(void) {
     return pa_tls_get(thread_tls);
 }
 
+void* pa_thread_get_data(pa_thread *t) {
+    pa_assert(t);
+
+    return t->userdata;
+}
+
+void pa_thread_set_data(pa_thread *t, void *userdata) {
+    pa_assert(t);
+
+    t->userdata = userdata;
+}
+
+void pa_thread_set_name(pa_thread *t, const char *name) {
+    /* Not implemented */
+}
+
+const char *pa_thread_get_name(pa_thread *t) {
+    /* Not implemented */
+    return NULL;
+}
+
 void pa_thread_yield(void) {
     Sleep(0);
 }
diff --git a/src/tests/once-test.c b/src/tests/once-test.c
index 1379168..8a9995d 100644
--- a/src/tests/once-test.c
+++ b/src/tests/once-test.c
@@ -21,7 +21,9 @@
 #include <config.h>
 #endif
 
+#ifdef HAVE_PTHREAD
 #include <pthread.h>
+#endif
 
 #include <pulsecore/thread.h>
 #include <pulsecore/once.h>
@@ -33,7 +35,9 @@
 static pa_once once = PA_ONCE_INIT;
 static volatile unsigned n_run = 0;
 static const char * volatile ran_by = NULL;
+#ifdef HAVE_PTHREAD
 static pthread_barrier_t barrier;
+#endif
 static unsigned n_cpu;
 
 #define N_ITERATIONS 500
@@ -45,6 +49,7 @@ static void once_func(void) {
 }
 
 static void thread_func(void *data) {
+#ifdef HAVE_PTHREAD
     int r;
 
 #ifdef HAVE_PTHREAD_SETAFFINITY_NP
@@ -60,6 +65,7 @@ static void thread_func(void *data) {
 
     r = pthread_barrier_wait(&barrier);
     pa_assert(r == 0 || r == PTHREAD_BARRIER_SERIAL_THREAD);
+#endif /* HAVE_PTHREAD */
 
     pa_run_once(&once, once_func);
 }
@@ -72,7 +78,9 @@ int main(int argc, char *argv[]) {
     for (n = 0; n < N_ITERATIONS; n++) {
         pa_thread* threads[N_THREADS];
 
+#ifdef HAVE_PTHREAD
         pa_assert_se(pthread_barrier_init(&barrier, NULL, N_THREADS) == 0);
+#endif
 
         /* Yes, kinda ugly */
         pa_zero(once);
@@ -94,7 +102,9 @@ int main(int argc, char *argv[]) {
         n_run = 0;
         ran_by = NULL;
 
+#ifdef HAVE_PTHREAD
         pa_assert_se(pthread_barrier_destroy(&barrier) == 0);
+#endif
     }
 
     return 0;
diff --git a/src/tests/thread-test.c b/src/tests/thread-test.c
index 4943a17..4071e42 100644
--- a/src/tests/thread-test.c
+++ b/src/tests/thread-test.c
@@ -94,8 +94,6 @@ int main(int argc, char *argv[]) {
     int i, k;
     pa_thread* t[THREADS_MAX];
 
-    assert(pa_thread_is_running(pa_thread_self()));
-
     mutex = pa_mutex_new(FALSE, FALSE);
     cond1 = pa_cond_new();
     cond2 = pa_cond_new();

commit 2cfacc6f5585f039fa85f849ddb9b89e4d33c432
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Thu Jun 23 22:21:01 2011 +0200

    build-sys: Cleanup Makefile.am
    
    No need to keep some tests in two lists.

diff --git a/src/Makefile.am b/src/Makefile.am
index 01c2ffc..3858cb3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -85,6 +85,7 @@ AM_LDFLAGS+=-Wl,-headerpad_max_install_names -headerpad_max_install_names
 endif
 
 FOREIGN_CFLAGS = -w
+
 MODULE_LDFLAGS = $(AM_LDFLAGS) -module -disable-static -avoid-version $(LDFLAGS_NOUNDEFINED)
 MODULE_LIBADD = $(AM_LIBADD) libpulsecore- at PA_MAJORMINOR@.la libpulsecommon- at PA_MAJORMINOR@.la libpulse.la
 
@@ -240,8 +241,6 @@ pabrowse_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
 #         Test programs           #
 ###################################
 
-# missing: mcalign-test flist-test pacat-simple parec-simple sync-playback rtstutter stripnul interpol-test thread-test connect-stress
-
 TESTS = \
 		mainloop-test \
 		strlist-test \
@@ -270,59 +269,27 @@ TESTS = \
 		lock-autospawn-test \
 		prioq-test
 
-TESTS_BINARIES = \
-		mainloop-test \
+TESTS_norun = \
 		mcalign-test \
 		pacat-simple \
 		parec-simple \
 		extended-test \
-		strlist-test \
-		close-test \
-		voltest \
-		vector-test \
-		memblockq-test \
 		sync-playback \
 		interpol-test \
-		channelmap-test \
-		thread-mainloop-test \
-		utf8-test \
-		format-test \
-		get-binary-name-test \
-		ipacl-test \
-		hook-list-test \
-		memblock-test \
 		thread-test \
 		flist-test \
-		asyncq-test \
-		asyncmsgq-test \
-		queue-test \
-		rtpoll-test \
-		sig2str-test \
-		resampler-test \
-		smoother-test \
-		mix-test \
-		remix-test \
-		proplist-test \
 		rtstutter \
 		stripnul \
-		lock-autospawn-test \
-		prioq-test \
 		connect-stress
 
 if !OS_IS_WIN32
 TESTS += \
 		sigbus-test \
 		usergroup-test
-TESTS_BINARIES += \
-		sigbus-test \
-		usergroup-test
 endif
 
 if HAVE_SIGXCPU
-#TESTS += \
-#		cpulimit-test \
-#		cpulimit-test2
-TESTS_BINARIES += \
+TESTS_norun += \
 		cpulimit-test \
 		cpulimit-test2
 endif
@@ -330,17 +297,15 @@ endif
 if HAVE_GLIB20
 TESTS += \
 		mainloop-test-glib
-TESTS_BINARIES += \
-		mainloop-test-glib
 endif
 
 if HAVE_GTK20
-TESTS_BINARIES += \
+TESTS_norun += \
 		gtk-test
 endif
 
 if HAVE_ALSA
-TESTS_BINARIES += \
+TESTS_norun += \
 		alsa-time-test
 endif
 
@@ -352,9 +317,9 @@ endif
 endif
 
 if BUILD_TESTS_DEFAULT
-noinst_PROGRAMS = $(TESTS_BINARIES)
+noinst_PROGRAMS = $(TESTS) $(TESTS_norun)
 else
-check_PROGRAMS = $(TESTS_BINARIES)
+check_PROGRAMS = $(TESTS) $(TESTS_norun)
 endif
 
 mainloop_test_SOURCES = tests/mainloop-test.c
@@ -664,7 +629,9 @@ libpulsecommon_ at PA_MAJORMINOR@_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version
 libpulsecommon_ at PA_MAJORMINOR@_la_LIBADD = $(AM_LIBADD) $(LIBWRAP_LIBS) $(WINSOCK_LIBS) $(LTLIBICONV) $(LIBSAMPLERATE_LIBS) $(LIBSNDFILE_LIBS) $(LIBJSON_LIBS)
 
 if HAVE_X11
-libpulsecommon_ at PA_MAJORMINOR@_la_SOURCES += pulse/client-conf-x11.c pulse/client-conf-x11.h
+libpulsecommon_ at PA_MAJORMINOR@_la_SOURCES += \
+		pulse/client-conf-x11.c pulse/client-conf-x11.h \
+		pulsecore/x11prop.c pulsecore/x11prop.h
 libpulsecommon_ at PA_MAJORMINOR@_la_CFLAGS += $(X11_CFLAGS)
 libpulsecommon_ at PA_MAJORMINOR@_la_LDFLAGS += $(X11_LIBS)
 endif
@@ -698,12 +665,6 @@ libpulsecommon_ at PA_MAJORMINOR@_la_SOURCES += \
 endif !OS_IS_DARWIN
 endif !OS_IS_WIN32
 
-if HAVE_X11
-libpulsecommon_ at PA_MAJORMINOR@_la_SOURCES += pulsecore/x11prop.c pulsecore/x11prop.h
-libpulsecommon_ at PA_MAJORMINOR@_la_CFLAGS += $(X11_CFLAGS)
-libpulsecommon_ at PA_MAJORMINOR@_la_LDFLAGS += $(X11_LIBS)
-endif
-
 if HAVE_LIBASYNCNS
 libpulsecommon_ at PA_MAJORMINOR@_la_CFLAGS += $(LIBASYNCNS_CFLAGS)
 libpulsecommon_ at PA_MAJORMINOR@_la_LIBADD += $(LIBASYNCNS_LIBS)

commit 8ce326816ba20d33f9d1ca5c2b290fa8a0b6f19c
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Thu Jun 23 22:21:00 2011 +0200

    Add sys/time.h include to rtclock.c
    
    Cross-compiling for win32 failed after the previous #include removal.
    Somehow when building for Linux the struct timeval definition got picked up elsewhere.

diff --git a/src/pulse/rtclock.c b/src/pulse/rtclock.c
index baa0f3a..dd1b600 100644
--- a/src/pulse/rtclock.c
+++ b/src/pulse/rtclock.c
@@ -23,7 +23,10 @@
 #include <config.h>
 #endif
 
+#include <sys/time.h>
+
 #include <pulse/timeval.h>
+
 #include <pulsecore/core-rtclock.h>
 
 #include "rtclock.h"

commit f0eab391df7c77b739eadc6c030ead1f4d68c72d
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Tue Mar 29 22:40:49 2011 +0200

    Remove obsolete description property from modules

diff --git a/src/modules/module-null-sink.c b/src/modules/module-null-sink.c
index 1db639f..bedd6ef 100644
--- a/src/modules/module-null-sink.c
+++ b/src/modules/module-null-sink.c
@@ -80,7 +80,6 @@ static const char* const valid_modargs[] = {
     "rate",
     "channels",
     "channel_map",
-    "description", /* supported for compatibility reasons, made redundant by sink_properties= */
     NULL
 };
 
@@ -282,7 +281,7 @@ int pa__init(pa_module*m) {
     pa_sink_new_data_set_name(&data, pa_modargs_get_value(ma, "sink_name", DEFAULT_SINK_NAME));
     pa_sink_new_data_set_sample_spec(&data, &ss);
     pa_sink_new_data_set_channel_map(&data, &map);
-    pa_proplist_sets(data.proplist, PA_PROP_DEVICE_DESCRIPTION, pa_modargs_get_value(ma, "description", _("Null Output")));
+    pa_proplist_sets(data.proplist, PA_PROP_DEVICE_DESCRIPTION, _("Null Output"));
     pa_proplist_sets(data.proplist, PA_PROP_DEVICE_CLASS, "abstract");
 
     if (pa_modargs_get_proplist(ma, "sink_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
diff --git a/src/modules/raop/module-raop-discover.c b/src/modules/raop/module-raop-discover.c
index da1e82b..de1a2b1 100644
--- a/src/modules/raop/module-raop-discover.c
+++ b/src/modules/raop/module-raop-discover.c
@@ -195,7 +195,7 @@ static void resolver_cb(
         if (nicename) {
             args = pa_sprintf_malloc("server=%s "
                                      "sink_name=%s "
-                                     "description=\"%s\"",
+                                     "sink_properties=device.description=\"%s\"",
                                      avahi_address_snprint(at, sizeof(at), a),
                                      vname,
                                      nicename);
diff --git a/src/modules/raop/module-raop-sink.c b/src/modules/raop/module-raop-sink.c
index 3f362b2..87e7bc1 100644
--- a/src/modules/raop/module-raop-sink.c
+++ b/src/modules/raop/module-raop-sink.c
@@ -118,7 +118,6 @@ static const char* const valid_modargs[] = {
     "format",
     "rate",
     "channels",
-    "description", /* supported for compatibility reasons, made redundant by sink_properties= */
     NULL
 };
 
@@ -507,7 +506,7 @@ int pa__init(pa_module*m) {
     struct userdata *u = NULL;
     pa_sample_spec ss;
     pa_modargs *ma = NULL;
-    const char *server, *desc;
+    const char *server;
     pa_sink_new_data data;
 
     pa_assert(m);
@@ -577,10 +576,7 @@ int pa__init(pa_module*m) {
     pa_sink_new_data_set_sample_spec(&data, &ss);
     pa_proplist_sets(data.proplist, PA_PROP_DEVICE_STRING, server);
     pa_proplist_sets(data.proplist, PA_PROP_DEVICE_INTENDED_ROLES, "music");
-    if ((desc = pa_modargs_get_value(ma, "description", NULL)))
-        pa_proplist_sets(data.proplist, PA_PROP_DEVICE_DESCRIPTION, desc);
-    else
-        pa_proplist_setf(data.proplist, PA_PROP_DEVICE_DESCRIPTION, "RAOP sink '%s'", server);
+    pa_proplist_setf(data.proplist, PA_PROP_DEVICE_DESCRIPTION, "RAOP sink '%s'", server);
 
     if (pa_modargs_get_proplist(ma, "sink_properties", data.proplist, PA_UPDATE_REPLACE) < 0) {
         pa_log("Invalid properties");



More information about the pulseaudio-commits mailing list