diff --git a/Makefile.am b/Makefile.am index 8735d312b..9a3ca7b71 100644 --- a/Makefile.am +++ b/Makefile.am @@ -61,6 +61,12 @@ dist-hook: ( git-changelog.perl || echo "git-changelog.perl failed." ) > ${distdir}/ChangeLog 2>&1 ; \ fi +update-shave: + for i in shave.in shave.m4 shave-libtool.in; do \ + wget -O $$i http://git.lespiau.name/cgit/shave/blob/\?path=shave/$$i ; \ + done + mv shave.m4 m4/ + .PHONY: homepage distcleancheck doxygen DISTCLEANFILES = \ diff --git a/bootstrap.sh b/bootstrap.sh index 4e223e326..cb74121e4 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -62,7 +62,7 @@ else rm -f Makefile.am~ configure.ac~ # Evil, evil, evil, evil hack - sed 's/read dummy/\#/' `which gettextize` | sh -s -- --copy --force + sed 's/read dummy/\#/' `which gettextize` | bash -s -- --copy --force test -f Makefile.am~ && mv Makefile.am~ Makefile.am test -f configure.ac~ && mv configure.ac~ configure.ac diff --git a/configure.ac b/configure.ac index b21312999..049589d45 100644 --- a/configure.ac +++ b/configure.ac @@ -70,8 +70,7 @@ fi case $host in *-*-solaris* ) - AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, Needed to get declarations for msg_control and msg_controllen on Solaris) - AC_DEFINE(_XOPEN_SOURCE, 2, Needed to get declarations for msg_control and msg_controllen on Solaris) + AC_DEFINE(_XOPEN_SOURCE, 600, Needed to get declarations for msg_control and msg_controllen on Solaris) AC_DEFINE(__EXTENSIONS__, 1, Needed to get declarations for msg_control and msg_controllen on Solaris) ;; esac @@ -92,11 +91,20 @@ AC_USE_SYSTEM_EXTENSIONS # M4 -AC_PATH_PROG([M4], [m4 gm4], [no]) +AC_CHECK_PROGS([M4], gm4 m4, no) if test "x$M4" = xno ; then AC_MSG_ERROR([m4 missing]) fi +# Linker + +AC_PROG_LD +AC_PROG_LD_GNU + +AC_SUBST(HAVE_GNU_LD) +AM_CONDITIONAL([HAVE_GNU_LD], [test "x$HAVE_GNU_LD" = x1]) + + 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" @@ -990,7 +998,7 @@ AC_ARG_ENABLE([udev], ], [udev=auto]) if test "x${udev}" != xno -a \( "x$HAVE_OSS" = "x1" -o "x$HAVE_ALSA" = "x1" \) ; then - PKG_CHECK_MODULES(UDEV, [ libudev ], + PKG_CHECK_MODULES(UDEV, [ libudev >= 137 ], [ HAVE_UDEV=1 AC_DEFINE([HAVE_UDEV], 1, [Have UDEV.]) @@ -1059,7 +1067,7 @@ if test "x$HAVE_HAL" = x1 ; then dbus=yes fi -if test "x${dbus}" != xno || test "x${bluez}" != xno || "x${hal}" != xno ; then +if test "x${dbus}" != xno || test "x${bluez}" != xno || test "x${hal}" != xno ; then PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 1.0.0 ], [ diff --git a/m4/shave.m4 b/m4/shave.m4 index 44d3908b9..0c2c9f5a0 100644 --- a/m4/shave.m4 +++ b/m4/shave.m4 @@ -1,9 +1,12 @@ dnl Make automake/libtool output more friendly to humans dnl -dnl SHAVE_INIT([shavedir]) +dnl SHAVE_INIT([shavedir],[default_mode]) dnl dnl shavedir: the directory where the shave scripts are, it defaults to dnl $(top_builddir) +dnl default_mode: (enable|disable) default shave mode. This parameter +dnl controls shave's behaviour when no option has been +dnl given to configure. It defaults to disable. dnl dnl * SHAVE_INIT should be called late in your configure.(ac|in) file (just dnl before AC_CONFIG_FILE/AC_OUTPUT is perfect. This macro rewrites CC and @@ -11,19 +14,26 @@ dnl LIBTOOL, you don't want the configure tests to have these variables dnl re-defined. dnl * This macro requires GNU make's -s option. +AC_DEFUN([_SHAVE_ARG_ENABLE], +[ + AC_ARG_ENABLE([shave], + AS_HELP_STRING( + [--enable-shave], + [use shave to make the build pretty [[default=$1]]]),, + [enable_shave=$1] + ) +]) + AC_DEFUN([SHAVE_INIT], [ - dnl enable/disable shave - AC_ARG_ENABLE([shave], - AS_HELP_STRING([--enable-shave], - [use shave to make the build pretty [[default=no]]]),, - [enable_shave=no]) + dnl you can tweak the default value of enable_shave + m4_if([$2], [enable], [_SHAVE_ARG_ENABLE(yes)], [_SHAVE_ARG_ENABLE(no)]) if test x"$enable_shave" = xyes; then dnl where can we find the shave scripts? m4_if([$1],, - [shavedir='$(top_builddir)'], - [shavedir='$(top_builddir)'/$1]) + [shavedir="$ac_pwd"], + [shavedir="$ac_pwd/$1"]) AC_SUBST(shavedir) dnl make is now quiet @@ -35,19 +45,22 @@ AC_DEFUN([SHAVE_INIT], dnl substitute libtool SHAVE_SAVED_LIBTOOL=$LIBTOOL - AC_SUBST(SHAVE_SAVED_LIBTOOL) - LIBTOOL="\$(SHELL) \$(shavedir)/shave-libtool '\$(SHAVE_SAVED_LIBTOOL)'" + LIBTOOL="${SHELL} ${shavedir}/shave-libtool '${SHAVE_SAVED_LIBTOOL}'" AC_SUBST(LIBTOOL) dnl substitute cc/cxx SHAVE_SAVED_CC=$CC SHAVE_SAVED_CXX=$CXX - AC_SUBST(SHAVE_SAVED_CC) - AC_SUBST(SHAVE_SAVED_CXX) - CC="\$(SHELL) \$(shavedir)/shave cc '\$(SHAVE_SAVED_CC)'" - CXX="\$(SHELL) \$(shavedir)/shave cxx '\$(SHAVE_SAVED_CXX)'" + SHAVE_SAVED_FC=$FC + SHAVE_SAVED_F77=$F77 + CC="${SHELL} ${shavedir}/shave cc ${SHAVE_SAVED_CC}" + CXX="${SHELL} ${shavedir}/shave cxx ${SHAVE_SAVED_CXX}" + FC="${SHELL} ${shavedir}/shave fc ${SHAVE_SAVED_FC}" + F77="${SHELL} ${shavedir}/shave f77 ${SHAVE_SAVED_F77}" AC_SUBST(CC) AC_SUBST(CXX) + AC_SUBST(FC) + AC_SUBST(F77) V=@ else @@ -58,12 +71,3 @@ AC_DEFUN([SHAVE_INIT], AC_SUBST(Q) ]) -AC_DEFUN([SHAVE_OUTPUT], -[ - if test x"$enable_shave" = xyes; then - dnl small workaround to fix libtool itself - dnl it's shokingly hard to find a better way, really! wtf... - test -f $srcdir/libtool && (tmpfile=`mktemp` && cat $srcdir/libtool | sed "s,^LTCC=.*$,LTCC=\"$SHELL $ac_pwd/shave cc $SHAVE_SAVED_CC\"," > $tmpfile && mv $tmpfile $srcdir/libtool) - fi - -]) diff --git a/shave-libtool.in b/shave-libtool.in index 30e6f1388..1f3a720c1 100644 --- a/shave-libtool.in +++ b/shave-libtool.in @@ -8,7 +8,7 @@ fi lt_unmangle () { - last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_]\*_la-##'` + last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'` } # the real libtool to use diff --git a/shave.in b/shave.in index dc46ec960..174641e9b 100644 --- a/shave.in +++ b/shave.in @@ -8,7 +8,7 @@ fi lt_unmangle () { - last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_]\*_la-##'` + last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'` } # the tool to wrap (cc, cxx, ar, ranlib, ..) @@ -50,6 +50,12 @@ link,*) *,cc) Q=" CC " ;; +*,fc) + Q=" FC " + ;; +*,f77) + Q=" F77 " + ;; *,*) # should not happen Q=" CC " diff --git a/src/Makefile.am b/src/Makefile.am index a70a19a10..848967785 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -713,8 +713,11 @@ libpulse_la_SOURCES = \ pulse/xmalloc.c pulse/xmalloc.h libpulse_la_CFLAGS = $(AM_CFLAGS) -libpulse_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBPULSE_VERSION_INFO) -Wl,-version-script=$(srcdir)/map-file libpulse_la_LIBADD = $(AM_LIBADD) $(WINSOCK_LIBS) $(LTLIBICONV) libpulsecommon-@PA_MAJORMINORMICRO@.la +libpulse_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBPULSE_VERSION_INFO) +if HAVE_GNU_LD +libpulse_la_LDFLAGS += -Wl,-version-script=$(srcdir)/map-file +endif if HAVE_X11 libpulse_la_SOURCES += pulse/client-conf-x11.c pulse/client-conf-x11.h @@ -725,17 +728,26 @@ endif libpulse_simple_la_SOURCES = pulse/simple.c pulse/simple.h libpulse_simple_la_CFLAGS = $(AM_CFLAGS) libpulse_simple_la_LIBADD = $(AM_LIBADD) libpulse.la libpulsecommon-@PA_MAJORMINORMICRO@.la -libpulse_simple_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBPULSE_SIMPLE_VERSION_INFO) -Wl,-version-script=$(srcdir)/map-file +libpulse_simple_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBPULSE_SIMPLE_VERSION_INFO) +if HAVE_GNU_LD +libpulse_simple_la_LDFLAGS += -Wl,-version-script=$(srcdir)/map-file +endif 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-@PA_MAJORMINORMICRO@.la $(AVAHI_LIBS) -libpulse_browse_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBPULSE_BROWSE_VERSION_INFO) -Wl,-version-script=$(srcdir)/map-file +libpulse_browse_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBPULSE_BROWSE_VERSION_INFO) +if HAVE_GNU_LD +libpulse_browse_la_LDFLAGS += -Wl,-version-script=$(srcdir)/map-file +endif 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-@PA_MAJORMINORMICRO@.la $(GLIB20_LIBS) -libpulse_mainloop_glib_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBPULSE_MAINLOOP_GLIB_VERSION_INFO) -Wl,-version-script=$(srcdir)/map-file +libpulse_mainloop_glib_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBPULSE_MAINLOOP_GLIB_VERSION_INFO) +if HAVE_GNU_LD +libpulse_mainloop_glib_la_LDFLAGS += -Wl,-version-script=$(srcdir)/map-file +endif ################################### # OSS emulation # diff --git a/src/daemon/caps.c b/src/daemon/caps.c index b5cbbc635..d2ae8d0e7 100644 --- a/src/daemon/caps.c +++ b/src/daemon/caps.c @@ -6,7 +6,7 @@ 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 of the License, + 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 diff --git a/src/daemon/caps.h b/src/daemon/caps.h index 176aa90e4..94241a9a0 100644 --- a/src/daemon/caps.h +++ b/src/daemon/caps.h @@ -8,7 +8,7 @@ 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 of the License, + 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 diff --git a/src/daemon/cmdline.c b/src/daemon/cmdline.c index f4224ea80..d78089e19 100644 --- a/src/daemon/cmdline.c +++ b/src/daemon/cmdline.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/daemon/cmdline.h b/src/daemon/cmdline.h index fd72a6d3a..e34d7f50f 100644 --- a/src/daemon/cmdline.h +++ b/src/daemon/cmdline.h @@ -8,7 +8,7 @@ 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 of the License, + 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 diff --git a/src/daemon/cpulimit.c b/src/daemon/cpulimit.c index 5f24474db..64728e27a 100644 --- a/src/daemon/cpulimit.c +++ b/src/daemon/cpulimit.c @@ -5,7 +5,7 @@ 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 of the + 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 diff --git a/src/daemon/cpulimit.h b/src/daemon/cpulimit.h index cb9a123d9..ce78d4839 100644 --- a/src/daemon/cpulimit.h +++ b/src/daemon/cpulimit.h @@ -8,7 +8,7 @@ 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 of the License, + 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 diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c index 10144ea45..ac6cc8aad 100644 --- a/src/daemon/daemon-conf.c +++ b/src/daemon/daemon-conf.c @@ -6,7 +6,7 @@ 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 of the License, + 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 @@ -94,8 +94,10 @@ static const pa_daemon_conf default_conf = { ,.rlimit_fsize = { .value = 0, .is_set = FALSE }, .rlimit_data = { .value = 0, .is_set = FALSE }, .rlimit_stack = { .value = 0, .is_set = FALSE }, - .rlimit_core = { .value = 0, .is_set = FALSE }, - .rlimit_rss = { .value = 0, .is_set = FALSE } + .rlimit_core = { .value = 0, .is_set = FALSE } +#ifdef RLIMIT_RSS + ,.rlimit_rss = { .value = 0, .is_set = FALSE } +#endif #ifdef RLIMIT_NPROC ,.rlimit_nproc = { .value = 0, .is_set = FALSE } #endif @@ -472,7 +474,9 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) { { "rlimit-data", parse_rlimit, &c->rlimit_data, NULL }, { "rlimit-stack", parse_rlimit, &c->rlimit_stack, NULL }, { "rlimit-core", parse_rlimit, &c->rlimit_core, NULL }, +#ifdef RLIMIT_RSS { "rlimit-rss", parse_rlimit, &c->rlimit_rss, NULL }, +#endif #ifdef RLIMIT_NOFILE { "rlimit-nofile", parse_rlimit, &c->rlimit_nofile, NULL }, #endif @@ -651,7 +655,9 @@ char *pa_daemon_conf_dump(pa_daemon_conf *c) { pa_strbuf_printf(s, "rlimit-data = %li\n", c->rlimit_data.is_set ? (long int) c->rlimit_data.value : -1); pa_strbuf_printf(s, "rlimit-stack = %li\n", c->rlimit_stack.is_set ? (long int) c->rlimit_stack.value : -1); pa_strbuf_printf(s, "rlimit-core = %li\n", c->rlimit_core.is_set ? (long int) c->rlimit_core.value : -1); +#ifdef RLIMIT_RSS pa_strbuf_printf(s, "rlimit-rss = %li\n", c->rlimit_rss.is_set ? (long int) c->rlimit_rss.value : -1); +#endif #ifdef RLIMIT_AS pa_strbuf_printf(s, "rlimit-as = %li\n", c->rlimit_as.is_set ? (long int) c->rlimit_as.value : -1); #endif diff --git a/src/daemon/daemon-conf.h b/src/daemon/daemon-conf.h index 9331280b5..9cec189f8 100644 --- a/src/daemon/daemon-conf.h +++ b/src/daemon/daemon-conf.h @@ -9,7 +9,7 @@ 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 of the License, + 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 @@ -87,8 +87,10 @@ typedef struct pa_daemon_conf { char *config_file; #ifdef HAVE_SYS_RESOURCE_H - pa_rlimit rlimit_fsize, rlimit_data, rlimit_stack, rlimit_core, rlimit_rss; - + pa_rlimit rlimit_fsize, rlimit_data, rlimit_stack, rlimit_core; +#ifdef RLIMIT_RSS + pa_rlimit rlimit_rss; +#endif #ifdef RLIMIT_NOFILE pa_rlimit rlimit_nofile; #endif diff --git a/src/daemon/dumpmodules.c b/src/daemon/dumpmodules.c index 9c9f1c813..0ffc0fc09 100644 --- a/src/daemon/dumpmodules.c +++ b/src/daemon/dumpmodules.c @@ -6,7 +6,7 @@ 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 of the License, + 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 diff --git a/src/daemon/dumpmodules.h b/src/daemon/dumpmodules.h index c49a5eda7..c3595e545 100644 --- a/src/daemon/dumpmodules.h +++ b/src/daemon/dumpmodules.h @@ -8,7 +8,7 @@ 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 of the License, + 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 diff --git a/src/daemon/ltdl-bind-now.c b/src/daemon/ltdl-bind-now.c index 8444cfb49..276b2a06e 100644 --- a/src/daemon/ltdl-bind-now.c +++ b/src/daemon/ltdl-bind-now.c @@ -6,7 +6,7 @@ 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 of the License, + 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 diff --git a/src/daemon/ltdl-bind-now.h b/src/daemon/ltdl-bind-now.h index f95d13b42..07600706e 100644 --- a/src/daemon/ltdl-bind-now.h +++ b/src/daemon/ltdl-bind-now.h @@ -8,7 +8,7 @@ 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 of the License, + 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 diff --git a/src/daemon/main.c b/src/daemon/main.c index b630bd173..0048e7b7b 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -6,7 +6,7 @@ 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 of the License, + 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 @@ -294,7 +294,9 @@ static void set_all_rlimits(const pa_daemon_conf *conf) { set_one_rlimit(&conf->rlimit_data, RLIMIT_DATA, "RLIMIT_DATA"); set_one_rlimit(&conf->rlimit_stack, RLIMIT_STACK, "RLIMIT_STACK"); set_one_rlimit(&conf->rlimit_core, RLIMIT_CORE, "RLIMIT_CORE"); +#ifdef RLIMIT_RSS set_one_rlimit(&conf->rlimit_rss, RLIMIT_RSS, "RLIMIT_RSS"); +#endif #ifdef RLIMIT_NPROC set_one_rlimit(&conf->rlimit_nproc, RLIMIT_NPROC, "RLIMIT_NPROC"); #endif diff --git a/src/daemon/polkit.c b/src/daemon/polkit.c index 921e5d1d4..9799e0948 100644 --- a/src/daemon/polkit.c +++ b/src/daemon/polkit.c @@ -6,7 +6,7 @@ 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 of the License, + 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 diff --git a/src/daemon/polkit.h b/src/daemon/polkit.h index 0d65ec520..018f6ef1c 100644 --- a/src/daemon/polkit.h +++ b/src/daemon/polkit.h @@ -8,7 +8,7 @@ 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 of the License, + 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 diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c index 7768b38e2..7bf16c3c6 100644 --- a/src/modules/alsa/alsa-sink.c +++ b/src/modules/alsa/alsa-sink.c @@ -6,7 +6,7 @@ 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 of the License, + 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 @@ -148,7 +148,7 @@ static void reserve_update(struct userdata *u) { const char *description; pa_assert(u); - if (!u->sink) + if (!u->sink || !u->reserve) return; if ((description = pa_proplist_gets(u->sink->proplist, PA_PROP_DEVICE_DESCRIPTION))) @@ -164,6 +164,9 @@ static int reserve_init(struct userdata *u, const char *dname) { if (u->reserve) return 0; + if (pa_in_system_mode()) + return 0; + /* We are resuming, try to lock the device */ if (!(rname = pa_alsa_get_reserve_name(dname))) return 0; @@ -1187,17 +1190,11 @@ static int process_rewind(struct userdata *u) { /* Figure out how much we shall rewind and reset the counter */ rewind_nbytes = u->sink->thread_info.rewind_nbytes; - u->sink->thread_info.rewind_nbytes = 0; - if (rewind_nbytes <= 0) - goto finish; - - pa_assert(rewind_nbytes > 0); pa_log_debug("Requested to rewind %lu bytes.", (unsigned long) rewind_nbytes); - snd_pcm_hwsync(u->pcm_handle); - if ((unused = snd_pcm_avail_update(u->pcm_handle)) < 0) { - pa_log("snd_pcm_avail_update() failed: %s", snd_strerror((int) unused)); + if (PA_UNLIKELY((unused = pa_alsa_safe_avail(u->pcm_handle, u->hwbuf_size, &u->sink->sample_spec)) < 0)) { + pa_log("snd_pcm_avail() failed: %s", snd_strerror((int) unused)); return -1; } @@ -1239,12 +1236,8 @@ static int process_rewind(struct userdata *u) { } else pa_log_debug("Mhmm, actually there is nothing to rewind."); -finish: - pa_sink_process_rewind(u->sink, 0); - return 0; - } static void thread_func(void *userdata) { @@ -1273,7 +1266,7 @@ static void thread_func(void *userdata) { int work_done; pa_usec_t sleep_usec = 0; - if (u->sink->thread_info.rewind_requested) + if (PA_UNLIKELY(u->sink->thread_info.rewind_requested)) if (process_rewind(u) < 0) goto fail; @@ -1699,11 +1692,10 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca u->watermark_step = pa_usec_to_bytes(TSCHED_WATERMARK_STEP_USEC, &u->sink->sample_spec); } - u->sink->thread_info.max_rewind = use_tsched ? u->hwbuf_size : 0; - u->sink->thread_info.max_request = u->hwbuf_size; - + pa_sink_set_max_rewind(u->sink, use_tsched ? u->hwbuf_size : 0); + pa_sink_set_max_request(u->sink, u->hwbuf_size); pa_sink_set_latency_range(u->sink, - !use_tsched ? pa_bytes_to_usec(u->hwbuf_size, &ss) : (pa_usec_t) -1, + use_tsched ? (pa_usec_t) -1 : pa_bytes_to_usec(u->hwbuf_size, &ss), pa_bytes_to_usec(u->hwbuf_size, &ss)); pa_log_info("Using %u fragments of size %lu bytes, buffer time is %0.2fms", diff --git a/src/modules/alsa/alsa-sink.h b/src/modules/alsa/alsa-sink.h index 47ece9e09..bbf64234b 100644 --- a/src/modules/alsa/alsa-sink.h +++ b/src/modules/alsa/alsa-sink.h @@ -9,7 +9,7 @@ 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 of the License, + 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 diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c index def638ec6..f4acad8cd 100644 --- a/src/modules/alsa/alsa-source.c +++ b/src/modules/alsa/alsa-source.c @@ -6,7 +6,7 @@ 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 of the License, + 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 @@ -146,7 +146,7 @@ static void reserve_update(struct userdata *u) { const char *description; pa_assert(u); - if (!u->source) + if (!u->source || !u->reserve) return; if ((description = pa_proplist_gets(u->source->proplist, PA_PROP_DEVICE_DESCRIPTION))) @@ -162,6 +162,9 @@ static int reserve_init(struct userdata *u, const char *dname) { if (u->reserve) return 0; + if (pa_in_system_mode()) + return 0; + /* We are resuming, try to lock the device */ if (!(rname = pa_alsa_get_reserve_name(dname))) return 0; @@ -1542,7 +1545,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p } pa_source_set_latency_range(u->source, - !use_tsched ? pa_bytes_to_usec(u->hwbuf_size, &ss) : (pa_usec_t) -1, + use_tsched ? (pa_usec_t) -1 : pa_bytes_to_usec(u->hwbuf_size, &ss), pa_bytes_to_usec(u->hwbuf_size, &ss)); pa_log_info("Using %u fragments of size %lu bytes, buffer time is %0.2fms", diff --git a/src/modules/alsa/alsa-source.h b/src/modules/alsa/alsa-source.h index 5fed6cc89..9cbb0e174 100644 --- a/src/modules/alsa/alsa-source.h +++ b/src/modules/alsa/alsa-source.h @@ -9,7 +9,7 @@ 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 of the License, + 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 diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c index 7d833ff7a..454cfd4ea 100644 --- a/src/modules/alsa/alsa-util.c +++ b/src/modules/alsa/alsa-util.c @@ -6,7 +6,7 @@ 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 of the License, + 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 diff --git a/src/modules/alsa/alsa-util.h b/src/modules/alsa/alsa-util.h index a8397ae9c..fe0f71e0e 100644 --- a/src/modules/alsa/alsa-util.h +++ b/src/modules/alsa/alsa-util.h @@ -9,7 +9,7 @@ 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 of the License, + 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 diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c index 9e149a482..d5e2cdc29 100644 --- a/src/modules/alsa/module-alsa-card.c +++ b/src/modules/alsa/module-alsa-card.c @@ -5,7 +5,7 @@ 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 of the License, + 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 @@ -310,8 +310,9 @@ int pa__init(pa_module *m) { pa_snprintf(rname, sizeof(rname), "Audio%i", alsa_card_index); - if (!(reserve = pa_reserve_wrapper_get(m->core, rname))) - goto fail; + if (!pa_in_system_mode()) + if (!(reserve = pa_reserve_wrapper_get(m->core, rname))) + goto fail; pa_card_new_data_init(&data); data.driver = __FILE__; diff --git a/src/modules/alsa/module-alsa-sink.c b/src/modules/alsa/module-alsa-sink.c index 4f844e082..c728a4464 100644 --- a/src/modules/alsa/module-alsa-sink.c +++ b/src/modules/alsa/module-alsa-sink.c @@ -6,7 +6,7 @@ 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 of the License, + 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 diff --git a/src/modules/alsa/module-alsa-source.c b/src/modules/alsa/module-alsa-source.c index c35936dfb..6188019f3 100644 --- a/src/modules/alsa/module-alsa-source.c +++ b/src/modules/alsa/module-alsa-source.c @@ -6,7 +6,7 @@ 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 of the License, + 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 diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c index 6b522200a..dfd3a3065 100644 --- a/src/modules/bluetooth/bluetooth-util.c +++ b/src/modules/bluetooth/bluetooth-util.c @@ -5,7 +5,7 @@ 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 of the + 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 diff --git a/src/modules/bluetooth/bluetooth-util.h b/src/modules/bluetooth/bluetooth-util.h index 2c3ec6497..0364c9724 100644 --- a/src/modules/bluetooth/bluetooth-util.h +++ b/src/modules/bluetooth/bluetooth-util.h @@ -8,7 +8,7 @@ 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 of the + 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 diff --git a/src/modules/bluetooth/ipc.h b/src/modules/bluetooth/ipc.h index 4203150bf..f030acfa2 100644 --- a/src/modules/bluetooth/ipc.h +++ b/src/modules/bluetooth/ipc.h @@ -160,7 +160,8 @@ struct bt_get_capabilities_req { #define BT_HFP_CODEC_PCM 0x00 -#define BT_PCM_FLAG_NREC 1 +#define BT_PCM_FLAG_NREC 0x01 +#define BT_PCM_FLAG_PCM_ROUTING 0x02 typedef struct { uint8_t transport; diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c index 3332df2cd..72cf20849 100644 --- a/src/modules/bluetooth/module-bluetooth-device.c +++ b/src/modules/bluetooth/module-bluetooth-device.c @@ -5,7 +5,7 @@ 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 of the + 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 diff --git a/src/modules/bluetooth/module-bluetooth-discover.c b/src/modules/bluetooth/module-bluetooth-discover.c index e97407492..521a9127b 100644 --- a/src/modules/bluetooth/module-bluetooth-discover.c +++ b/src/modules/bluetooth/module-bluetooth-discover.c @@ -5,7 +5,7 @@ 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 of the + 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 diff --git a/src/modules/bluetooth/module-bluetooth-proximity.c b/src/modules/bluetooth/module-bluetooth-proximity.c index f30d39fea..a3b525eee 100644 --- a/src/modules/bluetooth/module-bluetooth-proximity.c +++ b/src/modules/bluetooth/module-bluetooth-proximity.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/dbus-util.c b/src/modules/dbus-util.c index 4218bca56..d51befb92 100644 --- a/src/modules/dbus-util.c +++ b/src/modules/dbus-util.c @@ -6,7 +6,7 @@ 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 of the License, + 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 diff --git a/src/modules/dbus-util.h b/src/modules/dbus-util.h index fd9746730..90abbc7b8 100644 --- a/src/modules/dbus-util.h +++ b/src/modules/dbus-util.h @@ -8,7 +8,7 @@ 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 of the License, + 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 diff --git a/src/modules/gconf/gconf-helper.c b/src/modules/gconf/gconf-helper.c index f5016faf2..fbd8cfd83 100644 --- a/src/modules/gconf/gconf-helper.c +++ b/src/modules/gconf/gconf-helper.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/gconf/module-gconf.c b/src/modules/gconf/module-gconf.c index 845ede50b..c01ebbf68 100644 --- a/src/modules/gconf/module-gconf.c +++ b/src/modules/gconf/module-gconf.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/hal-util.c b/src/modules/hal-util.c index 6959a7062..422ae4ec8 100644 --- a/src/modules/hal-util.c +++ b/src/modules/hal-util.c @@ -5,7 +5,7 @@ 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 of the + 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 diff --git a/src/modules/hal-util.h b/src/modules/hal-util.h index 3c0e09437..19e41d774 100644 --- a/src/modules/hal-util.h +++ b/src/modules/hal-util.h @@ -8,7 +8,7 @@ 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 of the + 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 diff --git a/src/modules/module-always-sink.c b/src/modules/module-always-sink.c index 591695fbd..aee1c650f 100644 --- a/src/modules/module-always-sink.c +++ b/src/modules/module-always-sink.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-augment-properties.c b/src/modules/module-augment-properties.c index 99111868b..c3e5997a6 100644 --- a/src/modules/module-augment-properties.c +++ b/src/modules/module-augment-properties.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-card-restore.c b/src/modules/module-card-restore.c index c7696058b..0afb9353b 100644 --- a/src/modules/module-card-restore.c +++ b/src/modules/module-card-restore.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-cli.c b/src/modules/module-cli.c index 439aa8b0e..fd9452b49 100644 --- a/src/modules/module-cli.c +++ b/src/modules/module-cli.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-combine.c b/src/modules/module-combine.c index 6ed4f1413..4b2d6f9b3 100644 --- a/src/modules/module-combine.c +++ b/src/modules/module-combine.c @@ -5,7 +5,7 @@ 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 of the License, + 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 @@ -487,7 +487,7 @@ static void sink_input_kill_cb(pa_sink_input *i) { struct output *o; pa_sink_input_assert_ref(i); - pa_assert(o = i->userdata); + pa_assert_se(o = i->userdata); pa_module_unload_request(o->userdata->module, TRUE); output_free(o); diff --git a/src/modules/module-console-kit.c b/src/modules/module-console-kit.c index 805f5eef1..3fba7ef6c 100644 --- a/src/modules/module-console-kit.c +++ b/src/modules/module-console-kit.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-cork-music-on-phone.c b/src/modules/module-cork-music-on-phone.c index fb90cf345..c0f5eea46 100644 --- a/src/modules/module-cork-music-on-phone.c +++ b/src/modules/module-cork-music-on-phone.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-default-device-restore.c b/src/modules/module-default-device-restore.c index d299f40b6..a25aafcbd 100644 --- a/src/modules/module-default-device-restore.c +++ b/src/modules/module-default-device-restore.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-detect.c b/src/modules/module-detect.c index 773e1d875..49127abcd 100644 --- a/src/modules/module-detect.c +++ b/src/modules/module-detect.c @@ -7,7 +7,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-device-restore.c b/src/modules/module-device-restore.c index e6a48814e..0ca3dd83e 100644 --- a/src/modules/module-device-restore.c +++ b/src/modules/module-device-restore.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-esound-compat-spawnfd.c b/src/modules/module-esound-compat-spawnfd.c index 578ad3b50..56cda4dfb 100644 --- a/src/modules/module-esound-compat-spawnfd.c +++ b/src/modules/module-esound-compat-spawnfd.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-esound-compat-spawnpid.c b/src/modules/module-esound-compat-spawnpid.c index 882dba8c6..5925f591e 100644 --- a/src/modules/module-esound-compat-spawnpid.c +++ b/src/modules/module-esound-compat-spawnpid.c @@ -6,7 +6,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-esound-sink.c b/src/modules/module-esound-sink.c index 552cf75e5..2b45e302f 100644 --- a/src/modules/module-esound-sink.c +++ b/src/modules/module-esound-sink.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-hal-detect.c b/src/modules/module-hal-detect.c index ce04f3670..fe601100f 100644 --- a/src/modules/module-hal-detect.c +++ b/src/modules/module-hal-detect.c @@ -6,7 +6,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-jack-sink.c b/src/modules/module-jack-sink.c index 1739f46a8..63fdd2db2 100644 --- a/src/modules/module-jack-sink.c +++ b/src/modules/module-jack-sink.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-jack-source.c b/src/modules/module-jack-source.c index 38b63751a..c77c9581e 100644 --- a/src/modules/module-jack-source.c +++ b/src/modules/module-jack-source.c @@ -5,7 +5,7 @@ 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 of the License, + 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 @@ -163,7 +163,7 @@ static int jack_process(jack_nframes_t nframes, void *arg) { pa_assert(u); for (c = 0; c < u->channels; c++) - pa_assert(buffer[c] = jack_port_get_buffer(u->port[c], nframes)); + pa_assert_se(buffer[c] = jack_port_get_buffer(u->port[c], nframes)); /* We interleave the data and pass it on to the other RT thread */ diff --git a/src/modules/module-ladspa-sink.c b/src/modules/module-ladspa-sink.c index a4007b1a6..33562b104 100644 --- a/src/modules/module-ladspa-sink.c +++ b/src/modules/module-ladspa-sink.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-lirc.c b/src/modules/module-lirc.c index 9a782cacc..bdb8bb71e 100644 --- a/src/modules/module-lirc.c +++ b/src/modules/module-lirc.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-match.c b/src/modules/module-match.c index 179361105..d7365ca73 100644 --- a/src/modules/module-match.c +++ b/src/modules/module-match.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-mmkbd-evdev.c b/src/modules/module-mmkbd-evdev.c index a379923ad..2f87dd223 100644 --- a/src/modules/module-mmkbd-evdev.c +++ b/src/modules/module-mmkbd-evdev.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-native-protocol-fd.c b/src/modules/module-native-protocol-fd.c index f17f435ab..eed0505bf 100644 --- a/src/modules/module-native-protocol-fd.c +++ b/src/modules/module-native-protocol-fd.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-null-sink.c b/src/modules/module-null-sink.c index e18da5fd1..183d4b2e0 100644 --- a/src/modules/module-null-sink.c +++ b/src/modules/module-null-sink.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-pipe-sink.c b/src/modules/module-pipe-sink.c index f3b0e8b0e..def4f758f 100644 --- a/src/modules/module-pipe-sink.c +++ b/src/modules/module-pipe-sink.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-pipe-source.c b/src/modules/module-pipe-source.c index a42c53c36..3d40fdf3a 100644 --- a/src/modules/module-pipe-source.c +++ b/src/modules/module-pipe-source.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-position-event-sounds.c b/src/modules/module-position-event-sounds.c index 6252ebab8..e191ec33c 100644 --- a/src/modules/module-position-event-sounds.c +++ b/src/modules/module-position-event-sounds.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-protocol-stub.c b/src/modules/module-protocol-stub.c index ca9274d86..ce3dcd037 100644 --- a/src/modules/module-protocol-stub.c +++ b/src/modules/module-protocol-stub.c @@ -6,7 +6,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-raop-discover.c b/src/modules/module-raop-discover.c index df3931512..5c2e06233 100644 --- a/src/modules/module-raop-discover.c +++ b/src/modules/module-raop-discover.c @@ -6,7 +6,7 @@ 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 of the + 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 @@ -152,11 +152,18 @@ static void resolver_cb( if (event != AVAHI_RESOLVER_FOUND) pa_log("Resolving of '%s' failed: %s", name, avahi_strerror(avahi_client_errno(u->client))); else { - char *device = NULL, *dname, *vname, *args; + char *device = NULL, *nicename, *dname, *vname, *args; char at[AVAHI_ADDRESS_STR_MAX]; AvahiStringList *l; pa_module *m; + if ((nicename = strstr(name, "@"))) { + ++nicename; + if (strlen(nicename) > 0) { + pa_log_debug("Found RAOP: %s", nicename); + } + } + for (l = txt; l; l = l->next) { char *key, *value; pa_assert_se(avahi_string_list_get_pair(l, &key, &value, NULL) == 0); @@ -190,10 +197,20 @@ static void resolver_cb( "sink_name=%s", avahi_address_snprint(at, sizeof(at), a), port, vname);*/ - args = pa_sprintf_malloc("server=%s " - "sink_name=%s", - avahi_address_snprint(at, sizeof(at), a), - vname); + if (nicename) { + args = pa_sprintf_malloc("server=%s " + "sink_name=%s " + "description=\"%s\"", + avahi_address_snprint(at, sizeof(at), a), + vname, + nicename); + + } else { + args = pa_sprintf_malloc("server=%s " + "sink_name=%s", + avahi_address_snprint(at, sizeof(at), a), + vname); + } pa_log_debug("Loading module-raop-sink with arguments '%s'", args); diff --git a/src/modules/module-raop-sink.c b/src/modules/module-raop-sink.c index da338f5d7..00f0c63c0 100644 --- a/src/modules/module-raop-sink.c +++ b/src/modules/module-raop-sink.c @@ -6,7 +6,7 @@ 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 of the License, + 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 @@ -72,6 +72,7 @@ PA_MODULE_VERSION(PACKAGE_VERSION); PA_MODULE_LOAD_ONCE(FALSE); PA_MODULE_USAGE( "sink_name= " + "description= " "server=
" "format= " "channels= " @@ -122,6 +123,7 @@ static const char* const valid_modargs[] = { "format", "channels", "sink_name", + "description", NULL }; @@ -502,7 +504,7 @@ int pa__init(pa_module*m) { struct userdata *u = NULL; pa_sample_spec ss; pa_modargs *ma = NULL; - const char *server; + const char *server, *desc; pa_sink_new_data data; pa_assert(m); @@ -564,7 +566,10 @@ 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_proplist_sets(data.proplist, PA_PROP_DEVICE_STRING, server); - pa_proplist_setf(data.proplist, PA_PROP_DEVICE_DESCRIPTION, "RAOP sink '%s'", server); + 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); u->sink = pa_sink_new(m->core, &data, PA_SINK_LATENCY|PA_SINK_NETWORK); pa_sink_new_data_done(&data); diff --git a/src/modules/module-remap-sink.c b/src/modules/module-remap-sink.c index 89ddf9538..31824bc52 100644 --- a/src/modules/module-remap-sink.c +++ b/src/modules/module-remap-sink.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-rescue-streams.c b/src/modules/module-rescue-streams.c index e52e39c17..4f616e055 100644 --- a/src/modules/module-rescue-streams.c +++ b/src/modules/module-rescue-streams.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-sine-source.c b/src/modules/module-sine-source.c index 5626c2ab7..206c45f43 100644 --- a/src/modules/module-sine-source.c +++ b/src/modules/module-sine-source.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-sine.c b/src/modules/module-sine.c index ce08c01dd..0be1d7228 100644 --- a/src/modules/module-sine.c +++ b/src/modules/module-sine.c @@ -5,7 +5,7 @@ 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 of the License, + 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 diff --git a/src/modules/module-solaris.c b/src/modules/module-solaris.c index 6f50543ac..995b3c631 100644 --- a/src/modules/module-solaris.c +++ b/src/modules/module-solaris.c @@ -3,10 +3,11 @@ Copyright 2006 Lennart Poettering Copyright 2006-2007 Pierre Ossman for Cendio AB + Copyright 2009 Finn Thain 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 of the License, + 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 @@ -44,6 +45,7 @@ #include #include #include +#include #include #include @@ -57,22 +59,25 @@ #include #include #include +#include #include "module-solaris-symdef.h" -PA_MODULE_AUTHOR("Pierre Ossman") -PA_MODULE_DESCRIPTION("Solaris Sink/Source") -PA_MODULE_VERSION(PACKAGE_VERSION) +PA_MODULE_AUTHOR("Pierre Ossman"); +PA_MODULE_DESCRIPTION("Solaris Sink/Source"); +PA_MODULE_VERSION(PACKAGE_VERSION); PA_MODULE_USAGE( "sink_name= " "source_name= " - "device= record= " + "device=