summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--Makefile.am6
-rwxr-xr-xbootstrap.sh8
-rw-r--r--configure.ac64
-rw-r--r--m4/shave.m473
-rw-r--r--shave-libtool.in69
-rw-r--r--shave.in76
-rw-r--r--src/Makefile.am35
-rw-r--r--src/daemon/caps.c2
-rw-r--r--src/daemon/caps.h2
-rw-r--r--src/daemon/cmdline.c2
-rw-r--r--src/daemon/cmdline.h2
-rw-r--r--src/daemon/cpulimit.c2
-rw-r--r--src/daemon/cpulimit.h2
-rw-r--r--src/daemon/daemon-conf.c12
-rw-r--r--src/daemon/daemon-conf.h8
-rw-r--r--src/daemon/dumpmodules.c2
-rw-r--r--src/daemon/dumpmodules.h2
-rw-r--r--src/daemon/ltdl-bind-now.c2
-rw-r--r--src/daemon/ltdl-bind-now.h2
-rw-r--r--src/daemon/main.c4
-rw-r--r--src/daemon/polkit.c2
-rw-r--r--src/daemon/polkit.h2
-rw-r--r--src/modules/alsa/alsa-sink.c65
-rw-r--r--src/modules/alsa/alsa-sink.h2
-rw-r--r--src/modules/alsa/alsa-source.c37
-rw-r--r--src/modules/alsa/alsa-source.h2
-rw-r--r--src/modules/alsa/alsa-util.c44
-rw-r--r--src/modules/alsa/alsa-util.h3
-rw-r--r--src/modules/alsa/module-alsa-card.c8
-rw-r--r--src/modules/alsa/module-alsa-sink.c2
-rw-r--r--src/modules/alsa/module-alsa-source.c2
-rw-r--r--src/modules/bluetooth/bluetooth-util.c6
-rw-r--r--src/modules/bluetooth/bluetooth-util.h2
-rw-r--r--src/modules/bluetooth/ipc.h3
-rw-r--r--src/modules/bluetooth/module-bluetooth-device.c25
-rw-r--r--src/modules/bluetooth/module-bluetooth-discover.c2
-rw-r--r--src/modules/bluetooth/module-bluetooth-proximity.c2
-rw-r--r--src/modules/dbus-util.c2
-rw-r--r--src/modules/dbus-util.h2
-rw-r--r--src/modules/gconf/gconf-helper.c2
-rw-r--r--src/modules/gconf/module-gconf.c2
-rw-r--r--src/modules/hal-util.c5
-rw-r--r--src/modules/hal-util.h2
-rw-r--r--src/modules/module-always-sink.c2
-rw-r--r--src/modules/module-augment-properties.c2
-rw-r--r--src/modules/module-card-restore.c2
-rw-r--r--src/modules/module-cli.c2
-rw-r--r--src/modules/module-combine.c4
-rw-r--r--src/modules/module-console-kit.c2
-rw-r--r--src/modules/module-cork-music-on-phone.c2
-rw-r--r--src/modules/module-default-device-restore.c2
-rw-r--r--src/modules/module-detect.c2
-rw-r--r--src/modules/module-device-restore.c2
-rw-r--r--src/modules/module-esound-compat-spawnfd.c2
-rw-r--r--src/modules/module-esound-compat-spawnpid.c2
-rw-r--r--src/modules/module-esound-sink.c2
-rw-r--r--src/modules/module-hal-detect.c2
-rw-r--r--src/modules/module-jack-sink.c2
-rw-r--r--src/modules/module-jack-source.c4
-rw-r--r--src/modules/module-ladspa-sink.c2
-rw-r--r--src/modules/module-lirc.c2
-rw-r--r--src/modules/module-match.c2
-rw-r--r--src/modules/module-mmkbd-evdev.c2
-rw-r--r--src/modules/module-native-protocol-fd.c2
-rw-r--r--src/modules/module-null-sink.c2
-rw-r--r--src/modules/module-pipe-sink.c2
-rw-r--r--src/modules/module-pipe-source.c2
-rw-r--r--src/modules/module-position-event-sounds.c2
-rw-r--r--src/modules/module-protocol-stub.c2
-rw-r--r--src/modules/module-raop-discover.c29
-rw-r--r--src/modules/module-raop-sink.c11
-rw-r--r--src/modules/module-remap-sink.c2
-rw-r--r--src/modules/module-rescue-streams.c2
-rw-r--r--src/modules/module-sine-source.c2
-rw-r--r--src/modules/module-sine.c2
-rw-r--r--src/modules/module-solaris.c957
-rw-r--r--src/modules/module-stream-restore.c2
-rw-r--r--src/modules/module-suspend-on-idle.c65
-rw-r--r--src/modules/module-tunnel.c2
-rw-r--r--src/modules/module-volume-restore.c2
-rw-r--r--src/modules/module-waveout.c2
-rw-r--r--src/modules/module-x11-bell.c2
-rw-r--r--src/modules/module-x11-cork-request.c2
-rw-r--r--src/modules/module-x11-publish.c2
-rw-r--r--src/modules/module-x11-xsmp.c2
-rw-r--r--src/modules/module-zeroconf-discover.c2
-rw-r--r--src/modules/module-zeroconf-publish.c2
-rw-r--r--src/modules/oss/module-oss.c2
-rw-r--r--src/modules/oss/oss-util.c2
-rw-r--r--src/modules/oss/oss-util.h2
-rw-r--r--src/modules/raop/base64.c2
-rw-r--r--src/modules/raop/base64.h2
-rw-r--r--src/modules/raop/raop_client.c11
-rw-r--r--src/modules/raop/raop_client.h2
-rw-r--r--src/modules/reserve-wrap.c2
-rw-r--r--src/modules/reserve-wrap.h2
-rw-r--r--src/modules/reserve.h21
-rw-r--r--src/modules/rtp/module-rtp-recv.c2
-rw-r--r--src/modules/rtp/module-rtp-send.c2
-rw-r--r--src/modules/rtp/rtp.c2
-rw-r--r--src/modules/rtp/rtp.h2
-rw-r--r--src/modules/rtp/rtsp_client.c65
-rw-r--r--src/modules/rtp/rtsp_client.h2
-rw-r--r--src/modules/rtp/sap.c2
-rw-r--r--src/modules/rtp/sap.h2
-rw-r--r--src/modules/rtp/sdp.c2
-rw-r--r--src/modules/rtp/sdp.h2
-rw-r--r--src/modules/udev-util.c142
-rw-r--r--src/modules/udev-util.h30
-rw-r--r--src/pulse/browser.c2
-rw-r--r--src/pulse/browser.h2
-rw-r--r--src/pulse/cdecl.h2
-rw-r--r--src/pulse/channelmap.c2
-rw-r--r--src/pulse/channelmap.h2
-rw-r--r--src/pulse/client-conf-x11.c2
-rw-r--r--src/pulse/client-conf-x11.h2
-rw-r--r--src/pulse/client-conf.c2
-rw-r--r--src/pulse/client-conf.h2
-rw-r--r--src/pulse/context.c31
-rw-r--r--src/pulse/context.h2
-rw-r--r--src/pulse/def.h2
-rw-r--r--src/pulse/error.c10
-rw-r--r--src/pulse/error.h2
-rw-r--r--src/pulse/ext-stream-restore.c11
-rw-r--r--src/pulse/ext-stream-restore.h2
-rw-r--r--src/pulse/fork-detect.c59
-rw-r--r--src/pulse/fork-detect.h27
-rw-r--r--src/pulse/gccmacro.h2
-rw-r--r--src/pulse/glib-mainloop.c2
-rw-r--r--src/pulse/glib-mainloop.h2
-rw-r--r--src/pulse/internal.h2
-rw-r--r--src/pulse/introspect.c40
-rw-r--r--src/pulse/introspect.h3
-rw-r--r--src/pulse/mainloop-signal.c2
-rw-r--r--src/pulse/mainloop-signal.h2
-rw-r--r--src/pulse/mainloop.c2
-rw-r--r--src/pulse/mainloop.h2
-rw-r--r--src/pulse/operation.c2
-rw-r--r--src/pulse/operation.h2
-rw-r--r--src/pulse/proplist.h33
-rw-r--r--src/pulse/sample.c2
-rw-r--r--src/pulse/sample.h2
-rw-r--r--src/pulse/scache.c2
-rw-r--r--src/pulse/scache.h2
-rw-r--r--src/pulse/simple.c2
-rw-r--r--src/pulse/simple.h2
-rw-r--r--src/pulse/stream.c67
-rw-r--r--src/pulse/stream.h2
-rw-r--r--src/pulse/subscribe.c2
-rw-r--r--src/pulse/subscribe.h2
-rw-r--r--src/pulse/thread-mainloop.c2
-rw-r--r--src/pulse/thread-mainloop.h12
-rw-r--r--src/pulse/volume.c2
-rw-r--r--src/pulse/volume.h2
-rw-r--r--src/pulse/xmalloc.c2
-rw-r--r--src/pulse/xmalloc.h2
-rw-r--r--src/pulsecore/atomic.h2
-rw-r--r--src/pulsecore/auth-cookie.c2
-rw-r--r--src/pulsecore/auth-cookie.h2
-rw-r--r--src/pulsecore/avahi-wrap.c2
-rw-r--r--src/pulsecore/avahi-wrap.h2
-rw-r--r--src/pulsecore/bitset.c2
-rw-r--r--src/pulsecore/bitset.h2
-rw-r--r--src/pulsecore/card.c5
-rw-r--r--src/pulsecore/card.h2
-rw-r--r--src/pulsecore/cli-command.c27
-rw-r--r--src/pulsecore/cli-command.h2
-rw-r--r--src/pulsecore/cli-text.c2
-rw-r--r--src/pulsecore/cli-text.h2
-rw-r--r--src/pulsecore/cli.c2
-rw-r--r--src/pulsecore/cli.h2
-rw-r--r--src/pulsecore/client.c2
-rw-r--r--src/pulsecore/client.h2
-rw-r--r--src/pulsecore/conf-parser.c2
-rw-r--r--src/pulsecore/conf-parser.h2
-rw-r--r--src/pulsecore/core-error.c2
-rw-r--r--src/pulsecore/core-error.h2
-rw-r--r--src/pulsecore/core-scache.c2
-rw-r--r--src/pulsecore/core-scache.h2
-rw-r--r--src/pulsecore/core-subscribe.c2
-rw-r--r--src/pulsecore/core-subscribe.h2
-rw-r--r--src/pulsecore/core-util.c2
-rw-r--r--src/pulsecore/core.c13
-rw-r--r--src/pulsecore/core.h4
-rw-r--r--src/pulsecore/dllmain.c2
-rw-r--r--src/pulsecore/endianmacros.h2
-rw-r--r--src/pulsecore/esound.h2
-rw-r--r--src/pulsecore/ffmpeg/resample2.c27
-rw-r--r--src/pulsecore/flist.h2
-rw-r--r--src/pulsecore/hashmap.c2
-rw-r--r--src/pulsecore/hashmap.h2
-rw-r--r--src/pulsecore/hook-list.c2
-rw-r--r--src/pulsecore/hook-list.h2
-rw-r--r--src/pulsecore/ioline.c2
-rw-r--r--src/pulsecore/ioline.h2
-rw-r--r--src/pulsecore/llist.h2
-rw-r--r--src/pulsecore/lock-autospawn.c2
-rw-r--r--src/pulsecore/log.c2
-rw-r--r--src/pulsecore/log.h2
-rw-r--r--src/pulsecore/ltdl-helper.c2
-rw-r--r--src/pulsecore/ltdl-helper.h2
-rw-r--r--src/pulsecore/macro.h2
-rw-r--r--src/pulsecore/memblockq.c2
-rw-r--r--src/pulsecore/memblockq.h2
-rw-r--r--src/pulsecore/modargs.c2
-rw-r--r--src/pulsecore/modargs.h2
-rw-r--r--src/pulsecore/modinfo.c2
-rw-r--r--src/pulsecore/modinfo.h2
-rw-r--r--src/pulsecore/module.c2
-rw-r--r--src/pulsecore/module.h2
-rw-r--r--src/pulsecore/msgobject.c2
-rw-r--r--src/pulsecore/msgobject.h2
-rw-r--r--src/pulsecore/mutex-posix.c2
-rw-r--r--src/pulsecore/mutex-win32.c2
-rw-r--r--src/pulsecore/mutex.h2
-rw-r--r--src/pulsecore/namereg.c2
-rw-r--r--src/pulsecore/namereg.h2
-rw-r--r--src/pulsecore/object.c2
-rw-r--r--src/pulsecore/object.h2
-rw-r--r--src/pulsecore/once.c2
-rw-r--r--src/pulsecore/once.h2
-rw-r--r--src/pulsecore/pid.c2
-rw-r--r--src/pulsecore/pid.h2
-rw-r--r--src/pulsecore/pipe.c2
-rw-r--r--src/pulsecore/pipe.h2
-rw-r--r--src/pulsecore/play-memblockq.c2
-rw-r--r--src/pulsecore/play-memblockq.h2
-rw-r--r--src/pulsecore/play-memchunk.c2
-rw-r--r--src/pulsecore/play-memchunk.h2
-rw-r--r--src/pulsecore/poll.c2
-rw-r--r--src/pulsecore/poll.h2
-rw-r--r--src/pulsecore/prioq.c2
-rw-r--r--src/pulsecore/protocol-cli.c2
-rw-r--r--src/pulsecore/protocol-cli.h2
-rw-r--r--src/pulsecore/protocol-esound.c5
-rw-r--r--src/pulsecore/protocol-esound.h2
-rw-r--r--src/pulsecore/protocol-http.c2
-rw-r--r--src/pulsecore/protocol-http.h2
-rw-r--r--src/pulsecore/protocol-native.c4
-rw-r--r--src/pulsecore/protocol-native.h2
-rw-r--r--src/pulsecore/protocol-simple.c5
-rw-r--r--src/pulsecore/protocol-simple.h2
-rw-r--r--src/pulsecore/ratelimit.c2
-rw-r--r--src/pulsecore/ratelimit.h2
-rw-r--r--src/pulsecore/refcnt.h2
-rw-r--r--src/pulsecore/resampler.c2
-rw-r--r--src/pulsecore/resampler.h2
-rw-r--r--src/pulsecore/rtclock.c5
-rw-r--r--src/pulsecore/sample-util.c2
-rw-r--r--src/pulsecore/sample-util.h2
-rw-r--r--src/pulsecore/sconv-s16be.c2
-rw-r--r--src/pulsecore/sconv-s16be.h2
-rw-r--r--src/pulsecore/sconv-s16le.c2
-rw-r--r--src/pulsecore/sconv-s16le.h2
-rw-r--r--src/pulsecore/sconv.c2
-rw-r--r--src/pulsecore/sconv.h2
-rw-r--r--src/pulsecore/semaphore-posix.c2
-rw-r--r--src/pulsecore/semaphore-win32.c2
-rw-r--r--src/pulsecore/semaphore.h2
-rw-r--r--src/pulsecore/shared.c2
-rw-r--r--src/pulsecore/shared.h2
-rw-r--r--src/pulsecore/sink-input.c11
-rw-r--r--src/pulsecore/sink-input.h2
-rw-r--r--src/pulsecore/sink.c103
-rw-r--r--src/pulsecore/sink.h5
-rw-r--r--src/pulsecore/sioman.c2
-rw-r--r--src/pulsecore/sioman.h2
-rw-r--r--src/pulsecore/socket-server.c2
-rw-r--r--src/pulsecore/socket-server.h2
-rw-r--r--src/pulsecore/socket-util.c2
-rw-r--r--src/pulsecore/socket-util.h2
-rw-r--r--src/pulsecore/sound-file-stream.c2
-rw-r--r--src/pulsecore/sound-file-stream.h2
-rw-r--r--src/pulsecore/sound-file.c2
-rw-r--r--src/pulsecore/sound-file.h2
-rw-r--r--src/pulsecore/source-output.c11
-rw-r--r--src/pulsecore/source-output.h2
-rw-r--r--src/pulsecore/source.c37
-rw-r--r--src/pulsecore/source.h4
-rw-r--r--src/pulsecore/strbuf.c2
-rw-r--r--src/pulsecore/strbuf.h2
-rw-r--r--src/pulsecore/strlist.c2
-rw-r--r--src/pulsecore/strlist.h2
-rw-r--r--src/pulsecore/thread-posix.c2
-rw-r--r--src/pulsecore/thread-win32.c2
-rw-r--r--src/pulsecore/thread.h2
-rw-r--r--src/pulsecore/tokenizer.c2
-rw-r--r--src/pulsecore/tokenizer.h2
-rw-r--r--src/pulsecore/vector.h2
-rw-r--r--src/pulsecore/x11prop.c2
-rw-r--r--src/pulsecore/x11prop.h2
-rw-r--r--src/pulsecore/x11wrap.c2
-rw-r--r--src/pulsecore/x11wrap.h2
-rw-r--r--src/tests/asyncmsgq-test.c2
-rw-r--r--src/tests/asyncq-test.c2
-rw-r--r--src/tests/cpulimit-test.c2
-rw-r--r--src/tests/envelope-test.c2
-rw-r--r--src/tests/flist-test.c2
-rw-r--r--src/tests/get-binary-name-test.c2
-rw-r--r--src/tests/gtk-test.c2
-rw-r--r--src/tests/interpol-test.c19
-rw-r--r--src/tests/lock-autospawn-test.c2
-rw-r--r--src/tests/mainloop-test.c2
-rw-r--r--src/tests/memblock-test.c2
-rw-r--r--src/tests/memblockq-test.c2
-rw-r--r--src/tests/mix-test.c2
-rw-r--r--src/tests/pacat-simple.c2
-rw-r--r--src/tests/parec-simple.c2
-rw-r--r--src/tests/proplist-test.c2
-rw-r--r--src/tests/queue-test.c2
-rw-r--r--src/tests/remix-test.c2
-rw-r--r--src/tests/resampler-test.c2
-rw-r--r--src/tests/rtpoll-test.c2
-rw-r--r--src/tests/rtstutter.c2
-rw-r--r--src/tests/sig2str-test.c2
-rw-r--r--src/tests/smoother-test.c2
-rw-r--r--src/tests/stripnul.c2
-rw-r--r--src/tests/sync-playback.c2
-rw-r--r--src/tests/thread-mainloop-test.c2
-rw-r--r--src/tests/thread-test.c2
-rw-r--r--src/tests/vector-test.c2
-rw-r--r--src/utils/pabrowse.c2
-rw-r--r--src/utils/pacat.c2
-rw-r--r--src/utils/pacmd.c2
-rw-r--r--src/utils/pactl.c4
-rw-r--r--src/utils/padsp.c2
-rw-r--r--src/utils/paplay.c2
-rw-r--r--src/utils/pasuspender.c2
-rw-r--r--src/utils/pax11publish.c2
330 files changed, 2169 insertions, 850 deletions
diff --git a/.gitignore b/.gitignore
index f869d72d..e2a5091d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,6 @@
+shave
+shave-libtool
+.*.swp
ABOUT-NLS
intltool-extract.in
intltool-merge.in
diff --git a/Makefile.am b/Makefile.am
index 8735d312..9a3ca7b7 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 e64f3426..cb74121e 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -49,6 +49,10 @@ if ! pkg-config --version &>/dev/null; then
exit 1
fi
+if type -p colorgcc > /dev/null ; then
+ export CC=colorgcc
+fi
+
if [ "x$1" = "xam" ] ; then
run_versioned automake "$VERSION" -a -c --foreign
./config.status
@@ -58,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
@@ -73,7 +77,7 @@ else
run_versioned automake "$VERSION" --copy --foreign --add-missing
if test "x$NOCONFIGURE" = "x"; then
- CFLAGS="-g -O0" ./configure --sysconfdir=/etc --localstatedir=/var --enable-force-preopen "$@"
+ CFLAGS="-g -O0" ./configure --sysconfdir=/etc --localstatedir=/var --enable-force-preopen --enable-shave "$@"
make clean
fi
fi
diff --git a/configure.ac b/configure.ac
index 11b091bb..049589d4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,7 @@ m4_define(pa_major, [0])
m4_define(pa_minor, [9])
m4_define(pa_micro, [15])
-AC_INIT([pulseaudio],[pa_major.pa_minor.pa_micro-test2],[mzchyfrnhqvb (at) 0pointer (dot) net])
+AC_INIT([pulseaudio],[pa_major.pa_minor.pa_micro-test3],[mzchyfrnhqvb (at) 0pointer (dot) net])
AC_CONFIG_SRCDIR([src/daemon/main.c])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
@@ -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"
@@ -977,6 +985,41 @@ AC_SUBST(HAL_LIBS)
AC_SUBST(HAVE_HAL)
AM_CONDITIONAL([HAVE_HAL], [test "x$HAVE_HAL" = x1])
+#### UDEV support (optional) ####
+
+AC_ARG_ENABLE([udev],
+ AS_HELP_STRING([--disable-udev],[Disable optional UDEV support]),
+ [
+ case "${enableval}" in
+ yes) udev=yes ;;
+ no) udev=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --disable-udev) ;;
+ esac
+ ],
+ [udev=auto])
+if test "x${udev}" != xno -a \( "x$HAVE_OSS" = "x1" -o "x$HAVE_ALSA" = "x1" \) ; then
+ PKG_CHECK_MODULES(UDEV, [ libudev >= 137 ],
+ [
+ HAVE_UDEV=1
+ AC_DEFINE([HAVE_UDEV], 1, [Have UDEV.])
+ ],
+ [
+ HAVE_UDEV=0
+ if test "x$udev" = xyes ; then
+ AC_MSG_ERROR([*** UDEV support not found])
+ fi
+ ])
+else
+ HAVE_UDEV=0
+fi
+
+AC_SUBST(UDEV_CFLAGS)
+AC_SUBST(UDEV_LIBS)
+AC_SUBST(HAVE_UDEV)
+AM_CONDITIONAL([HAVE_UDEV], [test "x$HAVE_UDEV" = x1])
+
+AC_DEFINE([LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE], 1, [I know the API is subject to change.])
+
#### BlueZ support (optional) ####
AC_ARG_ENABLE([bluez],
@@ -1024,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 ],
[
@@ -1261,6 +1304,8 @@ AM_CONDITIONAL([FORCE_PREOPEN], [test "x$FORCE_PREOPEN" = "xyes"])
AC_CONFIG_FILES([
Makefile
+shave
+shave-libtool
src/Makefile
man/Makefile
libpulse.pc
@@ -1272,7 +1317,10 @@ doxygen/doxygen.conf
src/pulse/version.h
po/Makefile.in
])
+
+SHAVE_INIT
AC_OUTPUT
+SHAVE_OUTPUT
# ==========================================================================
ENABLE_X11=no
@@ -1335,6 +1383,11 @@ if test "x$HAVE_HAL" = "x1" ; then
ENABLE_HAL=yes
fi
+ENABLE_UDEV=no
+if test "x$HAVE_UDEV" = "x1" ; then
+ ENABLE_UDEV=yes
+fi
+
ENABLE_TCPWRAP=no
if test "x${LIBWRAP_LIBS}" != x ; then
ENABLE_TCPWRAP=yes
@@ -1394,6 +1447,7 @@ echo "
Enable Async DNS: ${ENABLE_LIBASYNCNS}
Enable LIRC: ${ENABLE_LIRC}
Enable HAL: ${ENABLE_HAL}
+ Enable udev: ${ENABLE_UDEV}
Enable BlueZ: ${ENABLE_BLUEZ}
Enable TCP Wrappers: ${ENABLE_TCPWRAP}
Enable libsamplerate: ${ENABLE_LIBSAMPLERATE}
diff --git a/m4/shave.m4 b/m4/shave.m4
new file mode 100644
index 00000000..0c2c9f5a
--- /dev/null
+++ b/m4/shave.m4
@@ -0,0 +1,73 @@
+dnl Make automake/libtool output more friendly to humans
+dnl
+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
+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 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="$ac_pwd"],
+ [shavedir="$ac_pwd/$1"])
+ AC_SUBST(shavedir)
+
+ dnl make is now quiet
+ AC_SUBST([MAKEFLAGS], [-s])
+ AC_SUBST([AM_MAKEFLAGS], ['`test -z $V && echo -s`'])
+
+ dnl we need sed
+ AC_CHECK_PROG(SED,sed,sed,false)
+
+ dnl substitute libtool
+ SHAVE_SAVED_LIBTOOL=$LIBTOOL
+ LIBTOOL="${SHELL} ${shavedir}/shave-libtool '${SHAVE_SAVED_LIBTOOL}'"
+ AC_SUBST(LIBTOOL)
+
+ dnl substitute cc/cxx
+ SHAVE_SAVED_CC=$CC
+ SHAVE_SAVED_CXX=$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
+ V=1
+ fi
+ Q='$(V:1=)'
+ AC_SUBST(V)
+ AC_SUBST(Q)
+])
+
diff --git a/shave-libtool.in b/shave-libtool.in
new file mode 100644
index 00000000..1f3a720c
--- /dev/null
+++ b/shave-libtool.in
@@ -0,0 +1,69 @@
+#!/bin/sh
+
+# we need sed
+SED=@SED@
+if test -z "$SED" ; then
+SED=sed
+fi
+
+lt_unmangle ()
+{
+ last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'`
+}
+
+# the real libtool to use
+LIBTOOL="$1"
+shift
+
+# if 1, don't print anything, the underlaying wrapper will do it
+pass_though=0
+
+# scan the arguments, keep the right ones for libtool, and discover the mode
+preserved_args=
+while test "$#" -gt 0; do
+ opt="$1"
+ shift
+
+ case $opt in
+ --mode=*)
+ mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'`
+ preserved_args="$preserved_args $opt"
+ ;;
+ -o)
+ lt_output="$1"
+ preserved_args="$preserved_args $opt"
+ ;;
+ *)
+ preserved_args="$preserved_args $opt"
+ ;;
+ esac
+done
+
+case "$mode" in
+compile)
+ # shave will be called and print the actual CC/CXX/LINK line
+ preserved_args="$preserved_args --shave-mode=$mode"
+ pass_though=1
+ ;;
+link)
+ preserved_args="$preserved_args --shave-mode=$mode"
+ Q=" LINK "
+ ;;
+*)
+ # let's u
+ # echo "*** libtool: Unimplemented mode: $mode, fill a bug report"
+ ;;
+esac
+
+lt_unmangle "$lt_output"
+output=$last_result
+
+if test -z $V; then
+ if test $pass_though -eq 0; then
+ echo "$Q$output"
+ fi
+ $LIBTOOL --silent $preserved_args
+else
+ echo $LIBTOOL $preserved_args
+ $LIBTOOL $preserved_args
+fi
diff --git a/shave.in b/shave.in
new file mode 100644
index 00000000..174641e9
--- /dev/null
+++ b/shave.in
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+# we need sed
+SED=@SED@
+if test -z "$SED" ; then
+SED=sed
+fi
+
+lt_unmangle ()
+{
+ last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'`
+}
+
+# the tool to wrap (cc, cxx, ar, ranlib, ..)
+tool="$1"
+shift
+
+# the reel tool (to call)
+REEL_TOOL="$1"
+shift
+
+pass_through=0
+preserved_args=
+while test "$#" -gt 0; do
+ opt="$1"
+ shift
+
+ case $opt in
+ --shave-mode=*)
+ mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'`
+ ;;
+ -o)
+ lt_output="$1"
+ preserved_args="$preserved_args $opt"
+ ;;
+ *)
+ preserved_args="$preserved_args $opt"
+ ;;
+ esac
+done
+
+# mode=link is handled in the libtool wrapper
+case "$mode,$tool" in
+link,*)
+ pass_through=1
+ ;;
+*,cxx)
+ Q=" CXX "
+ ;;
+*,cc)
+ Q=" CC "
+ ;;
+*,fc)
+ Q=" FC "
+ ;;
+*,f77)
+ Q=" F77 "
+ ;;
+*,*)
+ # should not happen
+ Q=" CC "
+ ;;
+esac
+
+lt_unmangle "$lt_output"
+output=$last_result
+
+if test -z $V; then
+ if test $pass_through -eq 0; then
+ echo "$Q$output"
+ fi
+ $REEL_TOOL $preserved_args
+else
+ echo $REEL_TOOL $preserved_args
+ $REEL_TOOL $preserved_args
+fi
diff --git a/src/Makefile.am b/src/Makefile.am
index 1fc87353..09bd9728 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -86,7 +86,7 @@ AM_LDFLAGS+=-Wl,--export-all-symbols
WINSOCK_LIBS=-lwsock32 -lws2_32 -lwininet
endif
-FOREIGN_CLFGAS = -w
+FOREIGN_CFLAGS = -w
MODULE_LDFLAGS = -module -disable-static -avoid-version
###################################
@@ -540,6 +540,7 @@ lib_LTLIBRARIES = \
libpulsecommon_@PA_MAJORMINORMICRO@_la_SOURCES = \
pulse/client-conf.c pulse/client-conf.h \
pulse/i18n.c pulse/i18n.h \
+ pulse/fork-detect.c pulse/fork-detect.h \
pulsecore/atomic.h \
pulsecore/authkey.c pulsecore/authkey.h \
pulsecore/conf-parser.c pulsecore/conf-parser.h \
@@ -713,8 +714,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 +729,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 #
@@ -818,7 +831,7 @@ noinst_LTLIBRARIES = libpulsecore-foreign.la
libpulsecore_foreign_la_SOURCES = \
pulsecore/ffmpeg/resample2.c pulsecore/ffmpeg/avcodec.h pulsecore/ffmpeg/dsputil.h
-libpulsecore_foreign_la_CFLAGS = $(AM_CFLAGS) -w
+libpulsecore_foreign_la_CFLAGS = $(AM_CFLAGS) $(FOREIGN_CFLAGS)
###################################
# Plug-in support libraries #
@@ -1313,9 +1326,15 @@ libalsa_util_la_LIBADD += $(HAL_LIBS)
libalsa_util_la_CFLAGS += $(HAL_CFLAGS)
endif
+if HAVE_UDEV
+libalsa_util_la_SOURCES += modules/udev-util.h modules/udev-util.c
+libalsa_util_la_LIBADD += $(UDEV_LIBS)
+libalsa_util_la_CFLAGS += $(UDEV_CFLAGS)
+endif
+
if HAVE_DBUS
libalsa_util_la_SOURCES += modules/reserve.h modules/reserve.c modules/reserve-wrap.c modules/reserve-wrap.h
-libalsa_util_la_LIBADD += $(DBUS_LIBS)
+libalsa_util_la_LIBADD += $(DBUS_LIBS) libdbus-util.la
libalsa_util_la_CFLAGS += $(DBUS_CFLAGS)
endif
@@ -1532,7 +1551,7 @@ libbluetooth_util_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
module_bluetooth_device_la_SOURCES = modules/bluetooth/module-bluetooth-device.c modules/bluetooth/rtp.h
module_bluetooth_device_la_LDFLAGS = $(MODULE_LDFLAGS)
-module_bluetooth_device_la_LIBADD = $(AM_LIBADD) $(DBUS_LIBS) libpulsecore-@PA_MAJORMINORMICRO@.la libdbus-util.la libbluetooth-ipc.la libbluetooth-sbc.la libpulsecommon-@PA_MAJORMINORMICRO@.la libpulse.la
+module_bluetooth_device_la_LIBADD = $(AM_LIBADD) $(DBUS_LIBS) libpulsecore-@PA_MAJORMINORMICRO@.la libdbus-util.la libbluetooth-util.la libbluetooth-ipc.la libbluetooth-sbc.la libpulsecommon-@PA_MAJORMINORMICRO@.la libpulse.la
module_bluetooth_device_la_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS)
# Apple Airtunes/RAOP
diff --git a/src/daemon/caps.c b/src/daemon/caps.c
index b5cbbc63..d2ae8d0e 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 176aa90e..94241a9a 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 f4224ea8..d78089e1 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 fd72a6d3..e34d7f50 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 5f24474d..64728e27 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 cb9a123d..ce78d483 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 10144ea4..ac6cc8aa 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 9331280b..9cec189f 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 9c9f1c81..0ffc0fc0 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 c49a5eda..c3595e54 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 8444cfb4..276b2a06 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 f95d13b4..07600706 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 b630bd17..0048e7b7 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 921e5d1d..9799e094 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 0d65ec52..018f6ef1 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 dbd95b63..7bf16c3c 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
@@ -61,10 +61,11 @@
/* #define DEBUG_TIMING */
#define DEFAULT_DEVICE "default"
-#define DEFAULT_TSCHED_BUFFER_USEC (2*PA_USEC_PER_SEC) /* 2s */
-#define DEFAULT_TSCHED_WATERMARK_USEC (20*PA_USEC_PER_MSEC) /* 20ms */
-#define TSCHED_MIN_SLEEP_USEC (10*PA_USEC_PER_MSEC) /* 10ms */
-#define TSCHED_MIN_WAKEUP_USEC (4*PA_USEC_PER_MSEC) /* 4ms */
+#define DEFAULT_TSCHED_BUFFER_USEC (2*PA_USEC_PER_SEC) /* 2s -- Overall buffer size */
+#define DEFAULT_TSCHED_WATERMARK_USEC (20*PA_USEC_PER_MSEC) /* 20ms -- Fill up when only this much is left in the buffer */
+#define TSCHED_WATERMARK_STEP_USEC (10*PA_USEC_PER_MSEC) /* 10ms -- On underrun, increase watermark by this */
+#define TSCHED_MIN_SLEEP_USEC (10*PA_USEC_PER_MSEC) /* 10ms -- Sleep at least 10ms on each iteration */
+#define TSCHED_MIN_WAKEUP_USEC (4*PA_USEC_PER_MSEC) /* 4ms -- Wakeup at least this long before the buffer runs empty*/
struct userdata {
pa_core *core;
@@ -86,7 +87,16 @@ struct userdata {
pa_bool_t mixer_seperate_channels:1;
pa_cvolume hardware_volume;
- size_t frame_size, fragment_size, hwbuf_size, tsched_watermark, hwbuf_unused, min_sleep, min_wakeup;
+ size_t
+ frame_size,
+ fragment_size,
+ hwbuf_size,
+ tsched_watermark,
+ hwbuf_unused,
+ min_sleep,
+ min_wakeup,
+ watermark_step;
+
unsigned nfragments;
pa_memchunk memchunk;
@@ -138,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)))
@@ -154,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;
@@ -205,10 +218,11 @@ static void adjust_after_underrun(struct userdata *u) {
pa_usec_t old_min_latency, new_min_latency;
pa_assert(u);
+ pa_assert(u->use_tsched);
/* First, just try to increase the watermark */
old_watermark = u->tsched_watermark;
- u->tsched_watermark *= 2;
+ u->tsched_watermark = PA_MIN(u->tsched_watermark * 2, u->tsched_watermark + u->watermark_step);
fix_tsched_watermark(u);
if (old_watermark != u->tsched_watermark) {
@@ -219,7 +233,8 @@ static void adjust_after_underrun(struct userdata *u) {
/* Hmm, we cannot increase the watermark any further, hence let's raise the latency */
old_min_latency = u->sink->thread_info.min_latency;
- new_min_latency = PA_MIN(old_min_latency * 2, u->sink->thread_info.max_latency);
+ new_min_latency = PA_MIN(old_min_latency * 2, old_min_latency + TSCHED_WATERMARK_STEP_USEC);
+ new_min_latency = PA_MIN(new_min_latency, u->sink->thread_info.max_latency);
if (old_min_latency != new_min_latency) {
pa_log_notice("Increasing minimal latency to %0.2f ms",
@@ -1175,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;
}
@@ -1227,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) {
@@ -1261,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;
@@ -1484,7 +1489,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
struct userdata *u = NULL;
const char *dev_id = NULL;
- pa_sample_spec ss;
+ pa_sample_spec ss, requested_ss;
pa_channel_map map;
uint32_t nfrags, hwbuf_size, frag_size, tsched_size, tsched_watermark;
snd_pcm_uframes_t period_frames, tsched_frames;
@@ -1503,6 +1508,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
goto fail;
}
+ requested_ss = ss;
frame_size = pa_frame_size(&ss);
nfrags = m->core->default_n_fragments;
@@ -1654,6 +1660,8 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_PROFILE_DESCRIPTION, profile->description);
}
+ pa_alsa_init_description(data.proplist);
+
u->sink = pa_sink_new(m->core, &data, PA_SINK_HARDWARE|PA_SINK_LATENCY);
pa_sink_new_data_done(&data);
@@ -1674,19 +1682,20 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
u->fragment_size = frag_size = (uint32_t) (period_frames * frame_size);
u->nfragments = nfrags;
u->hwbuf_size = u->fragment_size * nfrags;
- u->tsched_watermark = tsched_watermark;
+ u->tsched_watermark = pa_usec_to_bytes_round_up(pa_bytes_to_usec_round_up(tsched_watermark, &requested_ss), &u->sink->sample_spec);
pa_cvolume_mute(&u->hardware_volume, u->sink->sample_spec.channels);
if (use_tsched) {
fix_min_sleep_wakeup(u);
fix_tsched_watermark(u);
- }
- u->sink->thread_info.max_rewind = use_tsched ? u->hwbuf_size : 0;
- u->sink->thread_info.max_request = u->hwbuf_size;
+ u->watermark_step = pa_usec_to_bytes(TSCHED_WATERMARK_STEP_USEC, &u->sink->sample_spec);
+ }
+ 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 47ece9e0..bbf64234 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 39df4a91..f4acad8c 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
@@ -64,6 +64,7 @@
#define DEFAULT_DEVICE "default"
#define DEFAULT_TSCHED_BUFFER_USEC (2*PA_USEC_PER_SEC) /* 2s */
#define DEFAULT_TSCHED_WATERMARK_USEC (20*PA_USEC_PER_MSEC) /* 20ms */
+#define TSCHED_WATERMARK_STEP_USEC (10*PA_USEC_PER_MSEC) /* 10ms */
#define TSCHED_MIN_SLEEP_USEC (10*PA_USEC_PER_MSEC) /* 10ms */
#define TSCHED_MIN_WAKEUP_USEC (4*PA_USEC_PER_MSEC) /* 4ms */
@@ -88,7 +89,16 @@ struct userdata {
pa_cvolume hardware_volume;
- size_t frame_size, fragment_size, hwbuf_size, tsched_watermark, hwbuf_unused, min_sleep, min_wakeup;
+ size_t
+ frame_size,
+ fragment_size,
+ hwbuf_size,
+ tsched_watermark,
+ hwbuf_unused,
+ min_sleep,
+ min_wakeup,
+ watermark_step;
+
unsigned nfragments;
char *device_name;
@@ -136,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)))
@@ -152,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;
@@ -202,10 +215,12 @@ static void adjust_after_overrun(struct userdata *u) {
pa_usec_t old_min_latency, new_min_latency;
pa_assert(u);
+ pa_assert(u->use_tsched);
/* First, just try to increase the watermark */
old_watermark = u->tsched_watermark;
- u->tsched_watermark *= 2;
+ u->tsched_watermark = PA_MIN(u->tsched_watermark * 2, u->tsched_watermark + u->watermark_step);
+
fix_tsched_watermark(u);
if (old_watermark != u->tsched_watermark) {
@@ -216,7 +231,8 @@ static void adjust_after_overrun(struct userdata *u) {
/* Hmm, we cannot increase the watermark any further, hence let's raise the latency */
old_min_latency = u->source->thread_info.min_latency;
- new_min_latency = PA_MIN(old_min_latency * 2, u->source->thread_info.max_latency);
+ new_min_latency = PA_MIN(old_min_latency * 2, old_min_latency + TSCHED_WATERMARK_STEP_USEC);
+ new_min_latency = PA_MIN(new_min_latency, u->source->thread_info.max_latency);
if (old_min_latency != new_min_latency) {
pa_log_notice("Increasing minimal latency to %0.2f ms",
@@ -1331,7 +1347,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
struct userdata *u = NULL;
const char *dev_id = NULL;
- pa_sample_spec ss;
+ pa_sample_spec ss, requested_ss;
pa_channel_map map;
uint32_t nfrags, hwbuf_size, frag_size, tsched_size, tsched_watermark;
snd_pcm_uframes_t period_frames, tsched_frames;
@@ -1349,6 +1365,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
goto fail;
}
+ requested_ss = ss;
frame_size = pa_frame_size(&ss);
nfrags = m->core->default_n_fragments;
@@ -1495,6 +1512,8 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_PROFILE_DESCRIPTION, profile->description);
}
+ pa_alsa_init_description(data.proplist);
+
u->source = pa_source_new(m->core, &data, PA_SOURCE_HARDWARE|PA_SOURCE_LATENCY);
pa_source_new_data_done(&data);
@@ -1515,16 +1534,18 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
u->fragment_size = frag_size = (uint32_t) (period_frames * frame_size);
u->nfragments = nfrags;
u->hwbuf_size = u->fragment_size * nfrags;
- u->tsched_watermark = tsched_watermark;
+ u->tsched_watermark = pa_usec_to_bytes_round_up(pa_bytes_to_usec_round_up(tsched_watermark, &requested_ss), &u->source->sample_spec);
pa_cvolume_mute(&u->hardware_volume, u->source->sample_spec.channels);
if (use_tsched) {
fix_min_sleep_wakeup(u);
fix_tsched_watermark(u);
+
+ u->watermark_step = pa_usec_to_bytes(TSCHED_WATERMARK_STEP_USEC, &u->source->sample_spec);
}
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 5fed6cc8..9cbb0e17 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 6740c069..454cfd4e 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
@@ -47,6 +47,10 @@
#include "hal-util.h"
#endif
+#ifdef HAVE_UDEV
+#include "udev-util.h"
+#endif
+
struct pa_alsa_fdlist {
unsigned num_fds;
struct pollfd *fds;
@@ -1362,6 +1366,26 @@ void pa_alsa_redirect_errors_dec(void) {
snd_lib_error_set_handler(NULL);
}
+pa_bool_t pa_alsa_init_description(pa_proplist *p) {
+ const char *s;
+ pa_assert(p);
+
+ if (pa_device_init_description(p))
+ return TRUE;
+
+ if ((s = pa_proplist_gets(p, "alsa.card_name"))) {
+ pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, s);
+ return TRUE;
+ }
+
+ if ((s = pa_proplist_gets(p, "alsa.name"))) {
+ pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, s);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
void pa_alsa_init_proplist_card(pa_core *c, pa_proplist *p, int card) {
char *cn, *lcn, *dn;
@@ -1385,6 +1409,10 @@ void pa_alsa_init_proplist_card(pa_core *c, pa_proplist *p, int card) {
pa_xfree(dn);
}
+#ifdef HAVE_UDEV
+ pa_udev_get_info(c, p, card);
+#endif
+
#ifdef HAVE_HAL
pa_hal_get_info(c, p, card);
#endif
@@ -1411,7 +1439,7 @@ void pa_alsa_init_proplist_pcm_info(pa_core *c, pa_proplist *p, snd_pcm_info_t *
snd_pcm_class_t class;
snd_pcm_subclass_t subclass;
- const char *n, *id, *sdn, *cn = NULL;
+ const char *n, *id, *sdn;
int card;
pa_assert(p);
@@ -1426,6 +1454,7 @@ void pa_alsa_init_proplist_pcm_info(pa_core *c, pa_proplist *p, snd_pcm_info_t *
if (alsa_class_table[class])
pa_proplist_sets(p, "alsa.class", alsa_class_table[class]);
}
+
subclass = snd_pcm_info_get_subclass(pcm_info);
if (subclass <= SND_PCM_SUBCLASS_LAST)
if (alsa_subclass_table[subclass])
@@ -1443,17 +1472,8 @@ void pa_alsa_init_proplist_pcm_info(pa_core *c, pa_proplist *p, snd_pcm_info_t *
pa_proplist_setf(p, "alsa.device", "%u", snd_pcm_info_get_device(pcm_info));
- if ((card = snd_pcm_info_get_card(pcm_info)) >= 0) {
+ if ((card = snd_pcm_info_get_card(pcm_info)) >= 0)
pa_alsa_init_proplist_card(c, p, card);
- cn = pa_proplist_gets(p, "alsa.card_name");
- }
-
- if (cn && n && !strstr(cn, n) && !strstr(n, cn))
- pa_proplist_setf(p, PA_PROP_DEVICE_DESCRIPTION, "%s, %s", cn, n);
- else if (cn && (!n || strstr(cn, n)))
- pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, cn);
- else if (n)
- pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, n);
}
void pa_alsa_init_proplist_pcm(pa_core *c, pa_proplist *p, snd_pcm_t *pcm) {
diff --git a/src/modules/alsa/alsa-util.h b/src/modules/alsa/alsa-util.h
index 899532e2..fe0f71e0 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
@@ -123,6 +123,7 @@ void pa_alsa_redirect_errors_dec(void);
void pa_alsa_init_proplist_pcm_info(pa_core *c, pa_proplist *p, snd_pcm_info_t *pcm_info);
void pa_alsa_init_proplist_card(pa_core *c, pa_proplist *p, int card);
void pa_alsa_init_proplist_pcm(pa_core *c, pa_proplist *p, snd_pcm_t *pcm);
+pa_bool_t pa_alsa_init_description(pa_proplist *p);
int pa_alsa_recover_from_poll(snd_pcm_t *pcm, int revents);
diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
index fc6b886b..d5e2cdc2 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,14 +310,16 @@ 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__;
data.module = m;
pa_alsa_init_proplist_card(m->core, data.proplist, alsa_card_index);
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_STRING, u->device_id);
+ pa_alsa_init_description(data.proplist);
set_card_name(&data, ma, u->device_id);
if (reserve)
diff --git a/src/modules/alsa/module-alsa-sink.c b/src/modules/alsa/module-alsa-sink.c
index 4f844e08..c728a446 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 c35936df..6188019f 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 7855c2ef..dfd3a306 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
@@ -811,8 +811,8 @@ const char*pa_bluetooth_get_form_factor(uint32_t class) {
[1] = "headset",
[2] = "hands-free",
[4] = "microphone",
- [5] = "external-speakers",
- [6] = "headphones",
+ [5] = "speaker",
+ [6] = "headphone",
[7] = "portable",
[8] = "car",
[10] = "hifi"
diff --git a/src/modules/bluetooth/bluetooth-util.h b/src/modules/bluetooth/bluetooth-util.h
index 2c3ec649..0364c972 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 4203150b..f030acfa 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 b2fb1db1..495bc82f 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
@@ -921,7 +921,7 @@ static int hsp_process_push(struct userdata *u) {
if (l < 0 && errno == EINTR)
continue;
else {
- pa_log_error("Failed to read data from SCO socket: %s", ret < 0 ? pa_cstrerror(errno) : "EOF");
+ pa_log_error("Failed to read data from SCO socket: %s", l < 0 ? pa_cstrerror(errno) : "EOF");
ret = -1;
break;
}
@@ -1363,7 +1363,7 @@ static void sco_over_pcm_state_update(struct userdata *u) {
if (PA_SINK_IS_OPENED(pa_sink_get_state(u->hsp.sco_sink)) ||
PA_SOURCE_IS_OPENED(pa_source_get_state(u->hsp.sco_source))) {
- if (u->service_fd > 0)
+ if (u->service_fd >= 0)
return;
pa_log_debug("Resuming SCO over PCM");
@@ -1372,7 +1372,7 @@ static void sco_over_pcm_state_update(struct userdata *u) {
} else {
- if (u->service_fd <= 0)
+ if (u->service_fd < 0)
return;
pa_log_debug("Closing SCO over PCM");
@@ -1559,6 +1559,7 @@ static int setup_bt(struct userdata *u) {
static int init_profile(struct userdata *u) {
int r = 0;
pa_assert(u);
+ pa_assert(u->profile != PROFILE_OFF);
if (setup_bt(u) < 0)
return -1;
@@ -1688,7 +1689,9 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) {
u->sample_spec = u->requested_sample_spec;
init_bt(u);
- init_profile(u);
+
+ if (u->profile != PROFILE_OFF)
+ init_profile(u);
if (u->sink || u->source)
start_thread(u);
@@ -1728,7 +1731,7 @@ static int add_card(struct userdata *u, const char * default_profile) {
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_STRING, u->device->address);
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_API, "bluez");
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_CLASS, "sound");
- pa_proplist_sets(data.proplist, PA_PROP_DEVICE_CONNECTOR, "bluetooth");
+ pa_proplist_sets(data.proplist, PA_PROP_DEVICE_BUS, "bluetooth");
if ((ff = pa_bluetooth_get_form_factor(u->device->class)))
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_FORM_FACTOR, ff);
pa_proplist_sets(data.proplist, "bluez.path", u->device->path);
@@ -1909,8 +1912,9 @@ int pa__init(pa_module* m) {
if (init_bt(u) < 0)
goto fail;
- if (init_profile(u) < 0)
- goto fail;
+ if (u->profile != PROFILE_OFF)
+ if (init_profile(u) < 0)
+ goto fail;
/* if (u->path) { */
/* DBusError err; */
@@ -1948,8 +1952,9 @@ int pa__init(pa_module* m) {
/* } */
/* } */
- if (start_thread(u) < 0)
- goto fail;
+ if (u->sink || u->source)
+ if (start_thread(u) < 0)
+ goto fail;
return 0;
diff --git a/src/modules/bluetooth/module-bluetooth-discover.c b/src/modules/bluetooth/module-bluetooth-discover.c
index e9740749..521a9127 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 f30d39fe..a3b525ee 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 4218bca5..d51befb9 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 fd974673..90abbc7b 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 f5016faf..fbd8cfd8 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 845ede50..c01ebbf6 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 82bbc57e..422ae4ec 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
@@ -89,6 +89,9 @@ int pa_hal_get_info(pa_core *core, pa_proplist *p, int card) {
pa_proplist_sets(p, "hal.udi", udis[i]);
+ /* The data HAL stores in info.product is not actually a product
+ * string but simply the ALSA card name. We will hence not write
+ * it to PA_PROP_DEVICE_PRODUCT_NAME */
t = libhal_device_get_property_string(hal, udis[i], "info.product", &error);
if (dbus_error_is_set(&error))
dbus_error_free(&error);
diff --git a/src/modules/hal-util.h b/src/modules/hal-util.h
index 3c0e0943..19e41d77 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 591695fb..aee1c650 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 99111868..c3e5997a 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 c7696058..0afb9353 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 439aa8b0..fd9452b4 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 6ed4f141..4b2d6f9b 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 805f5eef..3fba7ef6 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 fb90cf34..c0f5eea4 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 d299f40b..a25aafcb 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 773e1d87..49127abc 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 e6a48814..0ca3dd83 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 578ad3b5..56cda4df 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 882dba8c..5925f591 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 552cf75e..2b45e302 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 ce04f367..fe601100 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 1739f46a..63fdd2db 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 38b63751..c77c9581 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 a4007b1a..33562b10 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 9a782cac..bdb8bb71 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 17936110..d7365ca7 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 a379923a..2f87dd22 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 f17f435a..eed0505b 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 e18da5fd..183d4b2e 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 f3b0e8b0..def4f758 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 a42c53c3..3d40fdf3 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 6252ebab..e191ec33 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 ca9274d8..ce3dcd03 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 df393151..5c2e0623 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 da338f5d..00f0c63c 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=<name for the sink> "
+ "description=<description for the sink> "
"server=<address> "
"format=<sample format> "
"channels=<number of 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 89ddf953..31824bc5 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 e52e39c1..4f616e05 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 5626c2ab..206c45f4 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 ce08c01d..0be1d722 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 6f50543a..995b3c63 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 <ossman@cendio.se> 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 <pulse/mainloop-signal.h>
#include <pulse/xmalloc.h>
#include <pulse/timeval.h>
+#include <pulse/util.h>
#include <pulsecore/iochannel.h>
#include <pulsecore/sink.h>
@@ -57,22 +59,25 @@
#include <pulsecore/thread-mq.h>
#include <pulsecore/rtpoll.h>
#include <pulsecore/thread.h>
+#include <pulsecore/rtclock.h>
#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=<name for the sink> "
"source_name=<name for the source> "
- "device=<OSS device> record=<enable source?> "
+ "device=<audio device file name> "
+ "record=<enable source?> "
"playback=<enable sink?> "
"format=<sample format> "
"channels=<number of channels> "
"rate=<sample rate> "
"buffer_size=<record buffer size> "
- "channel_map=<channel map>")
+ "channel_map=<channel map>");
+PA_MODULE_LOAD_ONCE(FALSE);
struct userdata {
pa_core *core;
@@ -87,15 +92,24 @@ struct userdata {
pa_memchunk memchunk;
- unsigned int page_size;
-
uint32_t frame_size;
- uint32_t buffer_size;
- unsigned int written_bytes, read_bytes;
+ int32_t buffer_size;
+ volatile uint64_t written_bytes, read_bytes;
+ pa_mutex *written_bytes_lock;
+ char *device_name;
+ int mode;
int fd;
pa_rtpoll_item *rtpoll_item;
pa_module *module;
+
+ pa_bool_t sink_suspended, source_suspended;
+
+ uint32_t play_samples_msw, record_samples_msw;
+ uint32_t prev_playback_samples, prev_record_samples;
+ pa_mutex *sample_counter_lock;
+
+ size_t min_request;
};
static const char* const valid_modargs[] = {
@@ -112,89 +126,303 @@ static const char* const valid_modargs[] = {
NULL
};
-#define DEFAULT_SINK_NAME "solaris_output"
-#define DEFAULT_SOURCE_NAME "solaris_input"
#define DEFAULT_DEVICE "/dev/audio"
+#define MIN_BUFFER_SIZE (640)
+#define MAX_RENDER_HZ (300)
-static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offset, pa_memchunk *chunk) {
- struct userdata *u = PA_SINK(o)->userdata;
+/* This render rate limit implies a minimum latency, but without it we waste too much CPU time in the
+ * IO thread. The maximum render rate and minimum latency (or minimum buffer size) are unachievable on
+ * common hardware anyway. Note that MIN_BUFFER_SIZE * MAX_RENDER_HZ >= 4 * 48000 Bps.
+ */
+
+static uint64_t get_playback_buffered_bytes(struct userdata *u) {
+ audio_info_t info;
+ uint64_t played_bytes;
int err;
+
+ pa_assert(u->sink);
+
+ pa_mutex_lock(u->sample_counter_lock);
+
+ err = ioctl(u->fd, AUDIO_GETINFO, &info);
+ pa_assert(err >= 0);
+
+ /* Handle wrap-around of the device's sample counter, which is a uint_32. */
+ if (u->prev_playback_samples > info.play.samples) {
+ /* Unfortunately info.play.samples can sometimes go backwards, even before it wraps! */
+ if (u->prev_playback_samples + info.play.samples < 240000) {
+ ++u->play_samples_msw;
+ } else {
+ pa_log_debug("play.samples went backwards %d bytes", u->prev_playback_samples - info.play.samples);
+ }
+ }
+ u->prev_playback_samples = info.play.samples;
+ played_bytes = (((uint64_t)u->play_samples_msw << 32) + info.play.samples) * u->frame_size;
+
+ pa_mutex_unlock(u->sample_counter_lock);
+
+ return u->written_bytes - played_bytes;
+}
+
+static pa_usec_t sink_get_latency(struct userdata *u, pa_sample_spec *ss) {
+ pa_usec_t r = 0;
+
+ pa_assert(u);
+ pa_assert(ss);
+
+ if (u->fd >= 0) {
+ pa_mutex_lock(u->written_bytes_lock);
+ r = pa_bytes_to_usec(get_playback_buffered_bytes(u), ss);
+ if (u->memchunk.memblock)
+ r += pa_bytes_to_usec(u->memchunk.length, ss);
+ pa_mutex_unlock(u->written_bytes_lock);
+ }
+ return r;
+}
+
+static uint64_t get_recorded_bytes(struct userdata *u) {
audio_info_t info;
+ uint64_t result;
+ int err;
- switch (code) {
- case PA_SINK_MESSAGE_GET_LATENCY: {
- pa_usec_t r = 0;
+ pa_assert(u->source);
- if (u->fd >= 0) {
+ err = ioctl(u->fd, AUDIO_GETINFO, &info);
+ pa_assert(err >= 0);
- err = ioctl(u->fd, AUDIO_GETINFO, &info);
- pa_assert(err >= 0);
+ if (u->prev_record_samples > info.record.samples)
+ ++u->record_samples_msw;
+ u->prev_record_samples = info.record.samples;
+ result = (((uint64_t)u->record_samples_msw << 32) + info.record.samples) * u->frame_size;
- r += pa_bytes_to_usec(u->written_bytes, &PA_SINK(o)->sample_spec);
- r -= pa_bytes_to_usec(info.play.samples * u->frame_size, &PA_SINK(o)->sample_spec);
+ return result;
+}
- if (u->memchunk.memblock)
- r += pa_bytes_to_usec(u->memchunk.length, &PA_SINK(o)->sample_spec);
- }
+static pa_usec_t source_get_latency(struct userdata *u, pa_sample_spec *ss) {
+ pa_usec_t r = 0;
+ audio_info_t info;
+
+ pa_assert(u);
+ pa_assert(ss);
- *((pa_usec_t*) data) = r;
+ if (u->fd) {
+ int err = ioctl(u->fd, AUDIO_GETINFO, &info);
+ pa_assert(err >= 0);
- return 0;
+ r = pa_bytes_to_usec(get_recorded_bytes(u), ss) - pa_bytes_to_usec(u->read_bytes, ss);
}
+ return r;
+}
- case PA_SINK_MESSAGE_SET_VOLUME:
- if (u->fd >= 0) {
- AUDIO_INITINFO(&info);
+static void build_pollfd(struct userdata *u) {
+ struct pollfd *pollfd;
- info.play.gain = pa_cvolume_avg((pa_cvolume*)data) * AUDIO_MAX_GAIN / PA_VOLUME_NORM;
- assert(info.play.gain <= AUDIO_MAX_GAIN);
+ pa_assert(u);
+ pa_assert(!u->rtpoll_item);
+ u->rtpoll_item = pa_rtpoll_item_new(u->rtpoll, PA_RTPOLL_NEVER, 1);
- if (ioctl(u->fd, AUDIO_SETINFO, &info) < 0) {
- if (errno == EINVAL)
- pa_log("AUDIO_SETINFO: Unsupported volume.");
- else
- pa_log("AUDIO_SETINFO: %s", pa_cstrerror(errno));
- } else {
- return 0;
- }
- }
- break;
+ pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);
+ pollfd->fd = u->fd;
+ pollfd->events = 0;
+ pollfd->revents = 0;
+}
- case PA_SINK_MESSAGE_GET_VOLUME:
- if (u->fd >= 0) {
- err = ioctl(u->fd, AUDIO_GETINFO, &info);
- assert(err >= 0);
+static int set_buffer(int fd, int buffer_size) {
+ audio_info_t info;
- pa_cvolume_set((pa_cvolume*) data, ((pa_cvolume*) data)->channels,
- info.play.gain * PA_VOLUME_NORM / AUDIO_MAX_GAIN);
+ pa_assert(fd >= 0);
- return 0;
- }
- break;
+ AUDIO_INITINFO(&info);
+ info.play.buffer_size = buffer_size;
+ info.record.buffer_size = buffer_size;
- case PA_SINK_MESSAGE_SET_MUTE:
- if (u->fd >= 0) {
- AUDIO_INITINFO(&info);
+ if (ioctl(fd, AUDIO_SETINFO, &info) < 0) {
+ if (errno == EINVAL)
+ pa_log("AUDIO_SETINFO: Unsupported buffer size.");
+ else
+ pa_log("AUDIO_SETINFO: %s", pa_cstrerror(errno));
+ return -1;
+ }
- info.output_muted = !!PA_PTR_TO_UINT(data);
+ return 0;
+}
- if (ioctl(u->fd, AUDIO_SETINFO, &info) < 0)
- pa_log("AUDIO_SETINFO: %s", pa_cstrerror(errno));
- else
- return 0;
+static int auto_format(int fd, int mode, pa_sample_spec *ss) {
+ audio_info_t info;
+
+ pa_assert(fd >= 0);
+ pa_assert(ss);
+
+ AUDIO_INITINFO(&info);
+
+ if (mode != O_RDONLY) {
+ info.play.sample_rate = ss->rate;
+ info.play.channels = ss->channels;
+ switch (ss->format) {
+ case PA_SAMPLE_U8:
+ info.play.precision = 8;
+ info.play.encoding = AUDIO_ENCODING_LINEAR;
+ break;
+ case PA_SAMPLE_ALAW:
+ info.play.precision = 8;
+ info.play.encoding = AUDIO_ENCODING_ALAW;
+ break;
+ case PA_SAMPLE_ULAW:
+ info.play.precision = 8;
+ info.play.encoding = AUDIO_ENCODING_ULAW;
+ break;
+ case PA_SAMPLE_S16NE:
+ info.play.precision = 16;
+ info.play.encoding = AUDIO_ENCODING_LINEAR;
+ break;
+ default:
+ pa_log("AUDIO_SETINFO: Unsupported sample format.");
+ return -1;
}
- break;
+ }
- case PA_SINK_MESSAGE_GET_MUTE:
- if (u->fd >= 0) {
- err = ioctl(u->fd, AUDIO_GETINFO, &info);
- pa_assert(err >= 0);
+ if (mode != O_WRONLY) {
+ info.record.sample_rate = ss->rate;
+ info.record.channels = ss->channels;
+ switch (ss->format) {
+ case PA_SAMPLE_U8:
+ info.record.precision = 8;
+ info.record.encoding = AUDIO_ENCODING_LINEAR;
+ break;
+ case PA_SAMPLE_ALAW:
+ info.record.precision = 8;
+ info.record.encoding = AUDIO_ENCODING_ALAW;
+ break;
+ case PA_SAMPLE_ULAW:
+ info.record.precision = 8;
+ info.record.encoding = AUDIO_ENCODING_ULAW;
+ break;
+ case PA_SAMPLE_S16NE:
+ info.record.precision = 16;
+ info.record.encoding = AUDIO_ENCODING_LINEAR;
+ break;
+ default:
+ pa_log("AUDIO_SETINFO: Unsupported sample format.");
+ return -1;
+ }
+ }
+
+ if (ioctl(fd, AUDIO_SETINFO, &info) < 0) {
+ if (errno == EINVAL)
+ pa_log("AUDIO_SETINFO: Failed to set sample format.");
+ else
+ pa_log("AUDIO_SETINFO: %s", pa_cstrerror(errno));
+ return -1;
+ }
+
+ return 0;
+}
+
+static int open_audio_device(struct userdata *u, pa_sample_spec *ss) {
+ pa_assert(u);
+ pa_assert(ss);
+
+ if ((u->fd = open(u->device_name, u->mode | O_NONBLOCK)) < 0) {
+ pa_log_warn("open %s failed (%s)", u->device_name, pa_cstrerror(errno));
+ return -1;
+ }
+
+ pa_log_info("device opened in %s mode.", u->mode == O_WRONLY ? "O_WRONLY" : (u->mode == O_RDONLY ? "O_RDONLY" : "O_RDWR"));
+
+ if (auto_format(u->fd, u->mode, ss) < 0)
+ return -1;
+
+ if (set_buffer(u->fd, u->buffer_size) < 0)
+ return -1;
+
+ u->written_bytes = u->read_bytes = 0;
+ u->play_samples_msw = u->record_samples_msw = 0;
+ u->prev_playback_samples = u->prev_record_samples = 0;
+
+ return u->fd;
+}
+
+static int suspend(struct userdata *u) {
+ pa_assert(u);
+ pa_assert(u->fd >= 0);
+
+ pa_log_info("Suspending...");
+
+ ioctl(u->fd, AUDIO_DRAIN, NULL);
+ pa_close(u->fd);
+ u->fd = -1;
+
+ if (u->rtpoll_item) {
+ pa_rtpoll_item_free(u->rtpoll_item);
+ u->rtpoll_item = NULL;
+ }
+
+ pa_log_info("Device suspended.");
+
+ return 0;
+}
+
+static int unsuspend(struct userdata *u) {
+ pa_assert(u);
+ pa_assert(u->fd < 0);
- *(int*)data = !!info.output_muted;
+ pa_log_info("Resuming...");
+ if (open_audio_device(u, u->sink ? &u->sink->sample_spec : &u->source->sample_spec) < 0)
+ return -1;
+
+ build_pollfd(u);
+
+ pa_log_info("Device resumed.");
+
+ return 0;
+}
+
+static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offset, pa_memchunk *chunk) {
+ struct userdata *u = PA_SINK(o)->userdata;
+
+ switch (code) {
+
+ case PA_SINK_MESSAGE_GET_LATENCY:
+ *((pa_usec_t*) data) = sink_get_latency(u, &PA_SINK(o)->sample_spec);
return 0;
- }
- break;
+
+ case PA_SINK_MESSAGE_SET_STATE:
+
+ switch ((pa_sink_state_t) PA_PTR_TO_UINT(data)) {
+
+ case PA_SINK_SUSPENDED:
+
+ pa_assert(PA_SINK_IS_OPENED(u->sink->thread_info.state));
+
+ if (!u->source || u->source_suspended) {
+ if (suspend(u) < 0)
+ return -1;
+ }
+ u->sink_suspended = TRUE;
+ break;
+
+ case PA_SINK_IDLE:
+ case PA_SINK_RUNNING:
+
+ if (u->sink->thread_info.state == PA_SINK_SUSPENDED) {
+ if (!u->source || u->source_suspended) {
+ if (unsuspend(u) < 0)
+ return -1;
+ u->sink->get_volume(u->sink);
+ u->sink->get_mute(u->sink);
+ }
+ u->sink_suspended = FALSE;
+ }
+ break;
+
+ case PA_SINK_INVALID_STATE:
+ case PA_SINK_UNLINKED:
+ case PA_SINK_INIT:
+ ;
+ }
+
+ break;
}
return pa_sink_process_msg(o, code, data, offset, chunk);
@@ -202,95 +430,168 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
static int source_process_msg(pa_msgobject *o, int code, void *data, int64_t offset, pa_memchunk *chunk) {
struct userdata *u = PA_SOURCE(o)->userdata;
- int err;
- audio_info_t info;
switch (code) {
- case PA_SOURCE_MESSAGE_GET_LATENCY: {
- pa_usec_t r = 0;
- if (u->fd) {
- err = ioctl(u->fd, AUDIO_GETINFO, &info);
- pa_assert(err >= 0);
+ case PA_SOURCE_MESSAGE_GET_LATENCY:
+ *((pa_usec_t*) data) = source_get_latency(u, &PA_SOURCE(o)->sample_spec);
+ return 0;
- r += pa_bytes_to_usec(info.record.samples * u->frame_size, &PA_SOURCE(o)->sample_spec);
- r -= pa_bytes_to_usec(u->read_bytes, &PA_SOURCE(o)->sample_spec);
- }
+ case PA_SOURCE_MESSAGE_SET_STATE:
- *((pa_usec_t*) data) = r;
+ switch ((pa_source_state_t) PA_PTR_TO_UINT(data)) {
- return 0;
- }
+ case PA_SOURCE_SUSPENDED:
- case PA_SOURCE_MESSAGE_SET_VOLUME:
- if (u->fd >= 0) {
- AUDIO_INITINFO(&info);
+ pa_assert(PA_SOURCE_IS_OPENED(u->source->thread_info.state));
- info.record.gain = pa_cvolume_avg((pa_cvolume*) data) * AUDIO_MAX_GAIN / PA_VOLUME_NORM;
- assert(info.record.gain <= AUDIO_MAX_GAIN);
+ if (!u->sink || u->sink_suspended) {
+ if (suspend(u) < 0)
+ return -1;
+ }
+ u->source_suspended = TRUE;
+ break;
+
+ case PA_SOURCE_IDLE:
+ case PA_SOURCE_RUNNING:
+
+ if (u->source->thread_info.state == PA_SOURCE_SUSPENDED) {
+ if (!u->sink || u->sink_suspended) {
+ if (unsuspend(u) < 0)
+ return -1;
+ u->source->get_volume(u->source);
+ }
+ u->source_suspended = FALSE;
+ }
+ break;
+
+ case PA_SOURCE_UNLINKED:
+ case PA_SOURCE_INIT:
+ case PA_SOURCE_INVALID_STATE:
+ ;
- if (ioctl(u->fd, AUDIO_SETINFO, &info) < 0) {
- if (errno == EINVAL)
- pa_log("AUDIO_SETINFO: Unsupported volume.");
- else
- pa_log("AUDIO_SETINFO: %s", pa_cstrerror(errno));
- } else {
- return 0;
- }
}
break;
- case PA_SOURCE_MESSAGE_GET_VOLUME:
- if (u->fd >= 0) {
- err = ioctl(u->fd, AUDIO_GETINFO, &info);
- pa_assert(err >= 0);
+ }
- pa_cvolume_set((pa_cvolume*) data, ((pa_cvolume*) data)->channels,
- info.record.gain * PA_VOLUME_NORM / AUDIO_MAX_GAIN);
+ return pa_source_process_msg(o, code, data, offset, chunk);
+}
- return 0;
- }
- break;
+static void sink_set_volume(pa_sink *s) {
+ struct userdata *u;
+ audio_info_t info;
+
+ pa_assert_se(u = s->userdata);
+
+ if (u->fd >= 0) {
+ AUDIO_INITINFO(&info);
+
+ info.play.gain = pa_cvolume_avg(&s->virtual_volume) * AUDIO_MAX_GAIN / PA_VOLUME_NORM;
+ assert(info.play.gain <= AUDIO_MAX_GAIN);
+
+ if (ioctl(u->fd, AUDIO_SETINFO, &info) < 0) {
+ if (errno == EINVAL)
+ pa_log("AUDIO_SETINFO: Unsupported volume.");
+ else
+ pa_log("AUDIO_SETINFO: %s", pa_cstrerror(errno));
+ }
}
+}
- return pa_source_process_msg(o, code, data, offset, chunk);
+static void sink_get_volume(pa_sink *s) {
+ struct userdata *u;
+ audio_info_t info;
+
+ pa_assert_se(u = s->userdata);
+
+ if (u->fd >= 0) {
+ if (ioctl(u->fd, AUDIO_GETINFO, &info) < 0)
+ pa_log("AUDIO_SETINFO: %s", pa_cstrerror(errno));
+ else
+ pa_cvolume_set(&s->virtual_volume, s->sample_spec.channels,
+ info.play.gain * PA_VOLUME_NORM / AUDIO_MAX_GAIN);
+ }
}
-static void clear_underflow(struct userdata *u)
-{
+static void source_set_volume(pa_source *s) {
+ struct userdata *u;
audio_info_t info;
- AUDIO_INITINFO(&info);
+ pa_assert_se(u = s->userdata);
+
+ if (u->fd >= 0) {
+ AUDIO_INITINFO(&info);
- info.play.error = 0;
+ info.play.gain = pa_cvolume_avg(&s->virtual_volume) * AUDIO_MAX_GAIN / PA_VOLUME_NORM;
+ assert(info.play.gain <= AUDIO_MAX_GAIN);
- if (ioctl(u->fd, AUDIO_SETINFO, &info) < 0)
- pa_log("AUDIO_SETINFO: %s", pa_cstrerror(errno));
+ if (ioctl(u->fd, AUDIO_SETINFO, &info) < 0) {
+ if (errno == EINVAL)
+ pa_log("AUDIO_SETINFO: Unsupported volume.");
+ else
+ pa_log("AUDIO_SETINFO: %s", pa_cstrerror(errno));
+ }
+ }
}
-static void clear_overflow(struct userdata *u)
-{
+static void source_get_volume(pa_source *s) {
+ struct userdata *u;
audio_info_t info;
- AUDIO_INITINFO(&info);
+ pa_assert_se(u = s->userdata);
- info.record.error = 0;
+ if (u->fd >= 0) {
+ if (ioctl(u->fd, AUDIO_GETINFO, &info) < 0)
+ pa_log("AUDIO_SETINFO: %s", pa_cstrerror(errno));
+ else
+ pa_cvolume_set(&s->virtual_volume, s->sample_spec.channels,
+ info.play.gain * PA_VOLUME_NORM / AUDIO_MAX_GAIN);
+ }
+}
+
+static void sink_set_mute(pa_sink *s) {
+ struct userdata *u = s->userdata;
+ audio_info_t info;
- if (ioctl(u->fd, AUDIO_SETINFO, &info) < 0)
- pa_log("AUDIO_SETINFO: %s", pa_cstrerror(errno));
+ pa_assert(u);
+
+ if (u->fd >= 0) {
+ AUDIO_INITINFO(&info);
+
+ info.output_muted = !!s->muted;
+
+ if (ioctl(u->fd, AUDIO_SETINFO, &info) < 0)
+ pa_log("AUDIO_SETINFO: %s", pa_cstrerror(errno));
+ }
+}
+
+static void sink_get_mute(pa_sink *s) {
+ struct userdata *u = s->userdata;
+ audio_info_t info;
+
+ pa_assert(u);
+
+ if (u->fd >= 0) {
+ if (ioctl(u->fd, AUDIO_GETINFO, &info) < 0)
+ pa_log("AUDIO_SETINFO: %s", pa_cstrerror(errno));
+ else
+ s->muted = !!info.output_muted;
+ }
}
static void thread_func(void *userdata) {
struct userdata *u = userdata;
unsigned short revents = 0;
- int ret;
+ int ret, err;
+ audio_info_t info;
pa_assert(u);
pa_log_debug("Thread starting up");
- if (u->core->high_priority)
- pa_make_realtime();
+ if (u->core->realtime_scheduling)
+ pa_make_realtime(u->core->realtime_priority);
pa_thread_mq_install(&u->thread_mq);
pa_rtpoll_install(u->rtpoll);
@@ -298,139 +599,158 @@ static void thread_func(void *userdata) {
for (;;) {
/* Render some data and write it to the dsp */
- if (u->sink && PA_SINK_OPENED(u->sink->thread_info.state)) {
- audio_info_t info;
- int err;
- size_t len;
+ if (u->sink && PA_SINK_IS_OPENED(u->sink->thread_info.state)) {
+ pa_usec_t xtime0;
+ uint64_t buffered_bytes;
+
+ if (u->sink->thread_info.rewind_requested)
+ pa_sink_process_rewind(u->sink, 0);
err = ioctl(u->fd, AUDIO_GETINFO, &info);
pa_assert(err >= 0);
- /*
- * Since we cannot modify the size of the output buffer we fake it
- * by not filling it more than u->buffer_size.
- */
- len = u->buffer_size;
- len -= u->written_bytes - (info.play.samples * u->frame_size);
-
- /* The sample counter can sometimes go backwards :( */
- if (len > u->buffer_size)
- len = 0;
-
if (info.play.error) {
- pa_log_debug("Solaris buffer underflow!");
- clear_underflow(u);
- }
+ pa_log_debug("buffer under-run!");
- len -= len % u->frame_size;
+ AUDIO_INITINFO(&info);
+ info.play.error = 0;
+ if (ioctl(u->fd, AUDIO_SETINFO, &info) < 0)
+ pa_log("AUDIO_SETINFO: %s", pa_cstrerror(errno));
+ }
- while (len) {
+ for (;;) {
void *p;
- ssize_t r;
+ ssize_t w;
+ size_t len;
+
+ /*
+ * Since we cannot modify the size of the output buffer we fake it
+ * by not filling it more than u->buffer_size.
+ */
+ xtime0 = pa_rtclock_usec();
+ buffered_bytes = get_playback_buffered_bytes(u);
+ if (buffered_bytes >= (uint64_t)u->buffer_size)
+ break;
- if (!u->memchunk.length)
- pa_sink_render(u->sink, len, &u->memchunk);
+ len = u->buffer_size - buffered_bytes;
+ len -= len % u->frame_size;
- pa_assert(u->memchunk.length);
+ if (len < u->min_request)
+ break;
+
+ if (u->memchunk.length < len)
+ pa_sink_render(u->sink, u->sink->thread_info.max_request, &u->memchunk);
p = pa_memblock_acquire(u->memchunk.memblock);
- r = pa_write(u->fd, (uint8_t*) p + u->memchunk.index, u->memchunk.length, NULL);
+ w = pa_write(u->fd, (uint8_t*) p + u->memchunk.index, u->memchunk.length, NULL);
pa_memblock_release(u->memchunk.memblock);
- if (r < 0) {
- if (errno == EINTR)
- continue;
- else if (errno != EAGAIN) {
- pa_log("Failed to read data from DSP: %s", pa_cstrerror(errno));
- goto fail;
+ if (w <= 0) {
+ switch (errno) {
+ case EINTR:
+ break;
+ case EAGAIN:
+ u->buffer_size = u->buffer_size * 18 / 25;
+ u->buffer_size -= u->buffer_size % u->frame_size;
+ u->buffer_size = PA_MAX(u->buffer_size, (int32_t)MIN_BUFFER_SIZE);
+ pa_sink_set_max_request(u->sink, u->buffer_size);
+ pa_log("EAGAIN. Buffer size is now %u bytes (%llu buffered)", u->buffer_size, buffered_bytes);
+ break;
+ default:
+ pa_log("Failed to write data to DSP: %s", pa_cstrerror(errno));
+ goto fail;
}
} else {
- pa_assert(r % u->frame_size == 0);
+ pa_assert(w % u->frame_size == 0);
- u->memchunk.index += r;
- u->memchunk.length -= r;
+ pa_mutex_lock(u->written_bytes_lock);
+ u->written_bytes += w;
+ u->memchunk.length -= w;
+ pa_mutex_unlock(u->written_bytes_lock);
+ u->memchunk.index += w;
if (u->memchunk.length <= 0) {
pa_memblock_unref(u->memchunk.memblock);
pa_memchunk_reset(&u->memchunk);
}
-
- len -= r;
- u->written_bytes += r;
}
}
+
+ pa_rtpoll_set_timer_absolute(u->rtpoll, xtime0 + pa_bytes_to_usec(buffered_bytes / 2, &u->sink->sample_spec));
+ } else {
+ pa_rtpoll_set_timer_disabled(u->rtpoll);
}
/* Try to read some data and pass it on to the source driver */
- if (u->source && PA_SOURCE_OPENED(u->source->thread_info.state) && ((revents & POLLIN))) {
+ if (u->source && PA_SOURCE_IS_OPENED(u->source->thread_info.state) && (revents & POLLIN)) {
pa_memchunk memchunk;
- int err;
- size_t l;
void *p;
ssize_t r;
- audio_info_t info;
+ size_t len;
err = ioctl(u->fd, AUDIO_GETINFO, &info);
pa_assert(err >= 0);
if (info.record.error) {
- pa_log_debug("Solaris buffer overflow!");
- clear_overflow(u);
+ pa_log_debug("buffer overflow!");
+
+ AUDIO_INITINFO(&info);
+ info.record.error = 0;
+ if (ioctl(u->fd, AUDIO_SETINFO, &info) < 0)
+ pa_log("AUDIO_SETINFO: %s", pa_cstrerror(errno));
}
- err = ioctl(u->fd, I_NREAD, &l);
+ err = ioctl(u->fd, I_NREAD, &len);
pa_assert(err >= 0);
- if (l > 0) {
- /* This is to make sure it fits in the memory pool. Also, a page
- should be the most efficient transfer size. */
- if (l > u->page_size)
- l = u->page_size;
-
- memchunk.memblock = pa_memblock_new(u->core->mempool, l);
+ if (len > 0) {
+ memchunk.memblock = pa_memblock_new(u->core->mempool, len);
pa_assert(memchunk.memblock);
p = pa_memblock_acquire(memchunk.memblock);
- r = pa_read(u->fd, p, l, NULL);
+ r = pa_read(u->fd, p, len, NULL);
pa_memblock_release(memchunk.memblock);
if (r < 0) {
pa_memblock_unref(memchunk.memblock);
- if (errno != EAGAIN) {
+ if (errno == EAGAIN)
+ break;
+ else {
pa_log("Failed to read data from DSP: %s", pa_cstrerror(errno));
goto fail;
}
} else {
+ u->read_bytes += r;
+
memchunk.index = 0;
memchunk.length = r;
pa_source_post(u->source, &memchunk);
pa_memblock_unref(memchunk.memblock);
- u->read_bytes += r;
-
revents &= ~POLLIN;
}
}
}
- if (u->fd >= 0) {
+ if (u->rtpoll_item) {
struct pollfd *pollfd;
+ pa_assert(u->fd >= 0);
+
pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);
- pollfd->events =
- ((u->source && PA_SOURCE_OPENED(u->source->thread_info.state)) ? POLLIN : 0);
+ pollfd->events = (u->source && PA_SOURCE_IS_OPENED(u->source->thread_info.state)) ? POLLIN : 0;
}
/* Hmm, nothing to do. Let's sleep */
- if ((ret = pa_rtpoll_run(u->rtpoll, 1)) < 0)
+ if ((ret = pa_rtpoll_run(u->rtpoll, TRUE)) < 0)
goto fail;
if (ret == 0)
goto finish;
- if (u->fd >= 0) {
+ if (u->rtpoll_item) {
struct pollfd *pollfd;
pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);
@@ -460,112 +780,29 @@ static void sig_callback(pa_mainloop_api *api, pa_signal_event*e, int sig, void
assert(u);
+ pa_log_debug("caught signal");
+
if (u->sink) {
- pa_sink_get_volume(u->sink);
- pa_sink_get_mute(u->sink);
+ pa_sink_get_volume(u->sink, TRUE);
+ pa_sink_get_mute(u->sink, TRUE);
}
if (u->source)
- pa_source_get_volume(u->source);
-}
-
-static int pa_solaris_auto_format(int fd, int mode, pa_sample_spec *ss) {
- audio_info_t info;
-
- AUDIO_INITINFO(&info);
-
- if (mode != O_RDONLY) {
- info.play.sample_rate = ss->rate;
- info.play.channels = ss->channels;
- switch (ss->format) {
- case PA_SAMPLE_U8:
- info.play.precision = 8;
- info.play.encoding = AUDIO_ENCODING_LINEAR;
- break;
- case PA_SAMPLE_ALAW:
- info.play.precision = 8;
- info.play.encoding = AUDIO_ENCODING_ALAW;
- break;
- case PA_SAMPLE_ULAW:
- info.play.precision = 8;
- info.play.encoding = AUDIO_ENCODING_ULAW;
- break;
- case PA_SAMPLE_S16NE:
- info.play.precision = 16;
- info.play.encoding = AUDIO_ENCODING_LINEAR;
- break;
- default:
- return -1;
- }
- }
-
- if (mode != O_WRONLY) {
- info.record.sample_rate = ss->rate;
- info.record.channels = ss->channels;
- switch (ss->format) {
- case PA_SAMPLE_U8:
- info.record.precision = 8;
- info.record.encoding = AUDIO_ENCODING_LINEAR;
- break;
- case PA_SAMPLE_ALAW:
- info.record.precision = 8;
- info.record.encoding = AUDIO_ENCODING_ALAW;
- break;
- case PA_SAMPLE_ULAW:
- info.record.precision = 8;
- info.record.encoding = AUDIO_ENCODING_ULAW;
- break;
- case PA_SAMPLE_S16NE:
- info.record.precision = 16;
- info.record.encoding = AUDIO_ENCODING_LINEAR;
- break;
- default:
- return -1;
- }
- }
-
- if (ioctl(fd, AUDIO_SETINFO, &info) < 0) {
- if (errno == EINVAL)
- pa_log("AUDIO_SETINFO: Unsupported sample format.");
- else
- pa_log("AUDIO_SETINFO: %s", pa_cstrerror(errno));
- return -1;
- }
-
- return 0;
-}
-
-static int pa_solaris_set_buffer(int fd, int buffer_size) {
- audio_info_t info;
-
- AUDIO_INITINFO(&info);
-
- info.play.buffer_size = buffer_size;
- info.record.buffer_size = buffer_size;
-
- if (ioctl(fd, AUDIO_SETINFO, &info) < 0) {
- if (errno == EINVAL)
- pa_log("AUDIO_SETINFO: Unsupported buffer size.");
- else
- pa_log("AUDIO_SETINFO: %s", pa_cstrerror(errno));
- return -1;
- }
-
- return 0;
+ pa_source_get_volume(u->source, TRUE);
}
int pa__init(pa_module *m) {
struct userdata *u = NULL;
- const char *p;
- int fd = -1;
- int buffer_size;
- int mode;
- int record = 1, playback = 1;
+ pa_bool_t record = TRUE, playback = TRUE;
pa_sample_spec ss;
pa_channel_map map;
pa_modargs *ma = NULL;
- char *t;
- struct pollfd *pollfd;
+ int fd;
+ pa_sink_new_data sink_new_data;
+ pa_source_new_data source_new_data;
+ char const *name;
+ char *name_buf;
+ pa_bool_t namereg_fail;
pa_assert(m);
@@ -575,7 +812,7 @@ int pa__init(pa_module *m) {
}
if (pa_modargs_get_value_boolean(ma, "record", &record) < 0 || pa_modargs_get_value_boolean(ma, "playback", &playback) < 0) {
- pa_log("record= and playback= expect numeric argument.");
+ pa_log("record= and playback= expect a boolean argument.");
goto fail;
}
@@ -584,97 +821,133 @@ int pa__init(pa_module *m) {
goto fail;
}
- mode = (playback&&record) ? O_RDWR : (playback ? O_WRONLY : (record ? O_RDONLY : 0));
+ u = pa_xnew0(struct userdata, 1);
+ u->sample_counter_lock = pa_mutex_new(FALSE, FALSE);
+ u->written_bytes_lock = pa_mutex_new(FALSE, FALSE);
- buffer_size = 16384;
- if (pa_modargs_get_value_s32(ma, "buffer_size", &buffer_size) < 0) {
- pa_log("failed to parse buffer size argument");
- goto fail;
- }
+ /*
+ * For a process (or several processes) to use the same audio device for both
+ * record and playback at the same time, the device's mixer must be enabled.
+ * See mixerctl(1). It may be turned off for playback only or record only.
+ */
+ u->mode = (playback && record) ? O_RDWR : (playback ? O_WRONLY : (record ? O_RDONLY : 0));
ss = m->core->default_sample_spec;
if (pa_modargs_get_sample_spec_and_channel_map(ma, &ss, &map, PA_CHANNEL_MAP_DEFAULT) < 0) {
pa_log("failed to parse sample specification");
goto fail;
}
+ u->frame_size = pa_frame_size(&ss);
- if ((fd = open(p = pa_modargs_get_value(ma, "device", DEFAULT_DEVICE), mode | O_NONBLOCK)) < 0)
+ u->buffer_size = 16384;
+ if (pa_modargs_get_value_s32(ma, "buffer_size", &u->buffer_size) < 0) {
+ pa_log("failed to parse buffer size argument");
goto fail;
-
- pa_log_info("device opened in %s mode.", mode == O_WRONLY ? "O_WRONLY" : (mode == O_RDONLY ? "O_RDONLY" : "O_RDWR"));
-
- if (pa_solaris_auto_format(fd, mode, &ss) < 0)
+ }
+ u->buffer_size -= u->buffer_size % u->frame_size;
+ if (u->buffer_size < (int32_t)MIN_BUFFER_SIZE) {
+ pa_log("supplied buffer size argument is too small");
goto fail;
+ }
+
+ u->device_name = pa_xstrdup(pa_modargs_get_value(ma, "device", DEFAULT_DEVICE));
- if (pa_solaris_set_buffer(fd, buffer_size) < 0)
+ if ((fd = open_audio_device(u, &ss)) < 0)
goto fail;
- u = pa_xmalloc(sizeof(struct userdata));
u->core = m->core;
-
- u->fd = fd;
-
- pa_memchunk_reset(&u->memchunk);
-
- /* We use this to get a reasonable chunk size */
- u->page_size = PA_PAGE_SIZE;
-
- u->frame_size = pa_frame_size(&ss);
- u->buffer_size = buffer_size;
-
- u->written_bytes = 0;
- u->read_bytes = 0;
-
u->module = m;
m->userdata = u;
- pa_thread_mq_init(&u->thread_mq, m->core->mainloop);
+ pa_memchunk_reset(&u->memchunk);
u->rtpoll = pa_rtpoll_new();
- pa_rtpoll_item_new_asyncmsgq(u->rtpoll, PA_RTPOLL_EARLY, u->thread_mq.inq);
+ pa_thread_mq_init(&u->thread_mq, m->core->mainloop, u->rtpoll);
- pa_rtpoll_set_timer_periodic(u->rtpoll, pa_bytes_to_usec(u->buffer_size / 10, &ss));
+ u->rtpoll_item = NULL;
+ build_pollfd(u);
- u->rtpoll_item = pa_rtpoll_item_new(u->rtpoll, PA_RTPOLL_NEVER, 1);
- pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);
- pollfd->fd = fd;
- pollfd->events = 0;
- pollfd->revents = 0;
+ if (u->mode != O_WRONLY) {
+ name_buf = NULL;
+ namereg_fail = TRUE;
- if (mode != O_WRONLY) {
- u->source = pa_source_new(m->core, __FILE__, pa_modargs_get_value(ma, "source_name", DEFAULT_SOURCE_NAME), 0, &ss, &map);
- pa_assert(u->source);
+ if (!(name = pa_modargs_get_value(ma, "source_name", NULL))) {
+ name = name_buf = pa_sprintf_malloc("solaris_input.%s", pa_path_get_filename(u->device_name));
+ namereg_fail = FALSE;
+ }
+
+ pa_source_new_data_init(&source_new_data);
+ source_new_data.driver = __FILE__;
+ source_new_data.module = m;
+ pa_source_new_data_set_name(&source_new_data, name);
+ source_new_data.namereg_fail = namereg_fail;
+ pa_source_new_data_set_sample_spec(&source_new_data, &ss);
+ pa_source_new_data_set_channel_map(&source_new_data, &map);
+ pa_proplist_sets(source_new_data.proplist, PA_PROP_DEVICE_STRING, u->device_name);
+ pa_proplist_sets(source_new_data.proplist, PA_PROP_DEVICE_API, "solaris");
+ pa_proplist_setf(source_new_data.proplist, PA_PROP_DEVICE_DESCRIPTION, "Solaris PCM source");
+ pa_proplist_sets(source_new_data.proplist, PA_PROP_DEVICE_ACCESS_MODE, "serial");
+ pa_proplist_setf(source_new_data.proplist, PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE, "%lu", (unsigned long) u->buffer_size);
+
+ u->source = pa_source_new(m->core, &source_new_data, PA_SOURCE_HARDWARE|PA_SOURCE_LATENCY|PA_SOURCE_HW_VOLUME_CTRL);
+ pa_source_new_data_done(&source_new_data);
+ pa_xfree(name_buf);
+
+ if (!u->source) {
+ pa_log("Failed to create source object");
+ goto fail;
+ }
u->source->userdata = u;
u->source->parent.process_msg = source_process_msg;
- pa_source_set_module(u->source, m);
- pa_source_set_description(u->source, t = pa_sprintf_malloc("Solaris PCM on '%s'", p));
- pa_xfree(t);
pa_source_set_asyncmsgq(u->source, u->thread_mq.inq);
pa_source_set_rtpoll(u->source, u->rtpoll);
- u->source->flags = PA_SOURCE_HARDWARE|PA_SOURCE_LATENCY|PA_SOURCE_HW_VOLUME_CTRL;
- u->source->refresh_volume = 1;
+ u->source->get_volume = source_get_volume;
+ u->source->set_volume = source_set_volume;
+ u->source->refresh_volume = TRUE;
} else
u->source = NULL;
- if (mode != O_RDONLY) {
- u->sink = pa_sink_new(m->core, __FILE__, pa_modargs_get_value(ma, "sink_name", DEFAULT_SINK_NAME), 0, &ss, &map);
- pa_assert(u->sink);
+ if (u->mode != O_RDONLY) {
+ name_buf = NULL;
+ namereg_fail = TRUE;
+ if (!(name = pa_modargs_get_value(ma, "sink_name", NULL))) {
+ name = name_buf = pa_sprintf_malloc("solaris_output.%s", pa_path_get_filename(u->device_name));
+ namereg_fail = FALSE;
+ }
+
+ pa_sink_new_data_init(&sink_new_data);
+ sink_new_data.driver = __FILE__;
+ sink_new_data.module = m;
+ pa_sink_new_data_set_name(&sink_new_data, name);
+ sink_new_data.namereg_fail = namereg_fail;
+ pa_sink_new_data_set_sample_spec(&sink_new_data, &ss);
+ pa_sink_new_data_set_channel_map(&sink_new_data, &map);
+ pa_proplist_sets(sink_new_data.proplist, PA_PROP_DEVICE_STRING, u->device_name);
+ pa_proplist_sets(sink_new_data.proplist, PA_PROP_DEVICE_API, "solaris");
+ pa_proplist_setf(sink_new_data.proplist, PA_PROP_DEVICE_DESCRIPTION, "Solaris PCM sink");
+ pa_proplist_sets(sink_new_data.proplist, PA_PROP_DEVICE_ACCESS_MODE, "serial");
+
+ u->sink = pa_sink_new(m->core, &sink_new_data, PA_SINK_HARDWARE|PA_SINK_LATENCY|PA_SINK_HW_VOLUME_CTRL|PA_SINK_HW_MUTE_CTRL);
+ pa_sink_new_data_done(&sink_new_data);
+ pa_assert(u->sink);
u->sink->userdata = u;
u->sink->parent.process_msg = sink_process_msg;
- pa_sink_set_module(u->sink, m);
- pa_sink_set_description(u->sink, t = pa_sprintf_malloc("Solaris PCM on '%s'", p));
- pa_xfree(t);
pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq);
pa_sink_set_rtpoll(u->sink, u->rtpoll);
- u->sink->flags = PA_SINK_HARDWARE|PA_SINK_LATENCY|PA_SINK_HW_VOLUME_CTRL;
- u->sink->refresh_volume = 1;
- u->sink->refresh_mute = 1;
+ u->sink->get_volume = sink_get_volume;
+ u->sink->set_volume = sink_set_volume;
+ u->sink->get_mute = sink_get_mute;
+ u->sink->set_mute = sink_set_mute;
+ u->sink->refresh_volume = u->sink->refresh_muted = TRUE;
+
+ u->sink->thread_info.max_request = u->buffer_size;
+ u->min_request = pa_usec_to_bytes(PA_USEC_PER_SEC / MAX_RENDER_HZ, &ss);
} else
u->sink = NULL;
@@ -690,17 +963,28 @@ int pa__init(pa_module *m) {
}
/* Read mixer settings */
- if (u->source)
- pa_asyncmsgq_send(u->thread_mq.inq, PA_MSGOBJECT(u->source), PA_SOURCE_MESSAGE_GET_VOLUME, &u->source->volume, 0, NULL);
if (u->sink) {
- pa_asyncmsgq_send(u->thread_mq.inq, PA_MSGOBJECT(u->sink), PA_SINK_MESSAGE_GET_VOLUME, &u->sink->volume, 0, NULL);
- pa_asyncmsgq_send(u->thread_mq.inq, PA_MSGOBJECT(u->sink), PA_SINK_MESSAGE_GET_MUTE, &u->sink->muted, 0, NULL);
- }
+ if (sink_new_data.volume_is_set)
+ u->sink->set_volume(u->sink);
+ else
+ u->sink->get_volume(u->sink);
+
+ if (sink_new_data.muted_is_set)
+ u->sink->set_mute(u->sink);
+ else
+ u->sink->get_mute(u->sink);
- if (u->sink)
pa_sink_put(u->sink);
- if (u->source)
+ }
+
+ if (u->source) {
+ if (source_new_data.volume_is_set)
+ u->source->set_volume(u->source);
+ else
+ u->source->get_volume(u->source);
+
pa_source_put(u->source);
+ }
pa_modargs_free(ma);
@@ -748,7 +1032,7 @@ void pa__done(pa_module *m) {
if (u->source)
pa_source_unref(u->source);
- if (u->memchunk.memblock)
+ if (u->memchunk.memblock)
pa_memblock_unref(u->memchunk.memblock);
if (u->rtpoll_item)
@@ -760,5 +1044,10 @@ void pa__done(pa_module *m) {
if (u->fd >= 0)
close(u->fd);
+ pa_mutex_free(u->written_bytes_lock);
+ pa_mutex_free(u->sample_counter_lock);
+
+ pa_xfree(u->device_name);
+
pa_xfree(u);
}
diff --git a/src/modules/module-stream-restore.c b/src/modules/module-stream-restore.c
index d935caf6..723b5d73 100644
--- a/src/modules/module-stream-restore.c
+++ b/src/modules/module-stream-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-suspend-on-idle.c b/src/modules/module-suspend-on-idle.c
index a5a3571c..7e17f8f7 100644
--- a/src/modules/module-suspend-on-idle.c
+++ b/src/modules/module-suspend-on-idle.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
@@ -149,7 +149,12 @@ static pa_hook_result_t source_output_fixate_hook_cb(pa_core *c, pa_source_outpu
pa_assert(data);
pa_assert(u);
- if ((d = pa_hashmap_get(u->device_infos, data->source)))
+ if (data->source->monitor_of)
+ d = pa_hashmap_get(u->device_infos, data->source->monitor_of);
+ else
+ d = pa_hashmap_get(u->device_infos, data->source);
+
+ if (d)
resume(d);
return PA_HOOK_OK;
@@ -173,6 +178,8 @@ static pa_hook_result_t sink_input_unlink_hook_cb(pa_core *c, pa_sink_input *s,
}
static pa_hook_result_t source_output_unlink_hook_cb(pa_core *c, pa_source_output *s, struct userdata *u) {
+ struct device_info *d = NULL;
+
pa_assert(c);
pa_source_output_assert_ref(s);
pa_assert(u);
@@ -180,12 +187,17 @@ static pa_hook_result_t source_output_unlink_hook_cb(pa_core *c, pa_source_outpu
if (!s->source)
return PA_HOOK_OK;
- if (pa_source_check_suspend(s->source) <= 0) {
- struct device_info *d;
- if ((d = pa_hashmap_get(u->device_infos, s->source)))
- restart(d);
+ if (s->source->monitor_of) {
+ if (pa_sink_check_suspend(s->source->monitor_of) <= 0)
+ d = pa_hashmap_get(u->device_infos, s->source->monitor_of);
+ } else {
+ if (pa_source_check_suspend(s->source) <= 0)
+ d = pa_hashmap_get(u->device_infos, s->source);
}
+ if (d)
+ restart(d);
+
return PA_HOOK_OK;
}
@@ -217,15 +229,22 @@ static pa_hook_result_t sink_input_move_finish_hook_cb(pa_core *c, pa_sink_input
}
static pa_hook_result_t source_output_move_start_hook_cb(pa_core *c, pa_source_output *s, struct userdata *u) {
- struct device_info *d;
+ struct device_info *d = NULL;
pa_assert(c);
pa_source_output_assert_ref(s);
pa_assert(u);
- if (pa_source_check_suspend(s->source) <= 1)
- if ((d = pa_hashmap_get(u->device_infos, s->source)))
- restart(d);
+ if (s->source->monitor_of) {
+ if (pa_sink_check_suspend(s->source->monitor_of) <= 1)
+ d = pa_hashmap_get(u->device_infos, s->source->monitor_of);
+ } else {
+ if (pa_source_check_suspend(s->source) <= 1)
+ d = pa_hashmap_get(u->device_infos, s->source);
+ }
+
+ if (d)
+ restart(d);
return PA_HOOK_OK;
}
@@ -237,7 +256,12 @@ static pa_hook_result_t source_output_move_finish_hook_cb(pa_core *c, pa_source_
pa_source_output_assert_ref(s);
pa_assert(u);
- if ((d = pa_hashmap_get(u->device_infos, s->source)))
+ if (s->source->monitor_of)
+ d = pa_hashmap_get(u->device_infos, s->source->monitor_of);
+ else
+ d = pa_hashmap_get(u->device_infos, s->source);
+
+ if (d)
resume(d);
return PA_HOOK_OK;
@@ -259,16 +283,25 @@ static pa_hook_result_t sink_input_state_changed_hook_cb(pa_core *c, pa_sink_inp
}
static pa_hook_result_t source_output_state_changed_hook_cb(pa_core *c, pa_source_output *s, struct userdata *u) {
- struct device_info *d;
pa_source_output_state_t state;
+
pa_assert(c);
pa_source_output_assert_ref(s);
pa_assert(u);
state = pa_source_output_get_state(s);
- if (state == PA_SOURCE_OUTPUT_RUNNING)
- if ((d = pa_hashmap_get(u->device_infos, s->source)))
+
+ if (state == PA_SOURCE_OUTPUT_RUNNING) {
+ struct device_info *d;
+
+ if (s->source->monitor_of)
+ d = pa_hashmap_get(u->device_infos, s->source->monitor_of);
+ else
+ d = pa_hashmap_get(u->device_infos, s->source);
+
+ if (d)
resume(d);
+ }
return PA_HOOK_OK;
}
@@ -285,6 +318,10 @@ static pa_hook_result_t device_new_hook_cb(pa_core *c, pa_object *o, struct user
source = pa_source_isinstance(o) ? PA_SOURCE(o) : NULL;
sink = pa_sink_isinstance(o) ? PA_SINK(o) : NULL;
+ /* Never suspend monitors */
+ if (source && source->monitor_of)
+ return PA_HOOK_OK;
+
pa_assert(source || sink);
d = pa_xnew(struct device_info, 1);
diff --git a/src/modules/module-tunnel.c b/src/modules/module-tunnel.c
index 63ae740a..c1488841 100644
--- a/src/modules/module-tunnel.c
+++ b/src/modules/module-tunnel.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-volume-restore.c b/src/modules/module-volume-restore.c
index 21c71491..61858afa 100644
--- a/src/modules/module-volume-restore.c
+++ b/src/modules/module-volume-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-waveout.c b/src/modules/module-waveout.c
index b452c3bf..2d35828d 100644
--- a/src/modules/module-waveout.c
+++ b/src/modules/module-waveout.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-x11-bell.c b/src/modules/module-x11-bell.c
index bef02536..ac303c3b 100644
--- a/src/modules/module-x11-bell.c
+++ b/src/modules/module-x11-bell.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-x11-cork-request.c b/src/modules/module-x11-cork-request.c
index 0c9aedf4..c1380c27 100644
--- a/src/modules/module-x11-cork-request.c
+++ b/src/modules/module-x11-cork-request.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-x11-publish.c b/src/modules/module-x11-publish.c
index fb27eba2..7d71067b 100644
--- a/src/modules/module-x11-publish.c
+++ b/src/modules/module-x11-publish.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-x11-xsmp.c b/src/modules/module-x11-xsmp.c
index 5fc8047d..28fd373a 100644
--- a/src/modules/module-x11-xsmp.c
+++ b/src/modules/module-x11-xsmp.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-zeroconf-discover.c b/src/modules/module-zeroconf-discover.c
index 5123ead8..3da946e0 100644
--- a/src/modules/module-zeroconf-discover.c
+++ b/src/modules/module-zeroconf-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/module-zeroconf-publish.c b/src/modules/module-zeroconf-publish.c
index 985564f4..692ffe91 100644
--- a/src/modules/module-zeroconf-publish.c
+++ b/src/modules/module-zeroconf-publish.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/oss/module-oss.c b/src/modules/oss/module-oss.c
index 54d1679f..7bce8d00 100644
--- a/src/modules/oss/module-oss.c
+++ b/src/modules/oss/module-oss.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/oss/oss-util.c b/src/modules/oss/oss-util.c
index f04b875d..5a109ae9 100644
--- a/src/modules/oss/oss-util.c
+++ b/src/modules/oss/oss-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/oss/oss-util.h b/src/modules/oss/oss-util.h
index 654f7bba..845b0c8f 100644
--- a/src/modules/oss/oss-util.h
+++ b/src/modules/oss/oss-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/raop/base64.c b/src/modules/raop/base64.c
index 059c7028..e1cbed02 100644
--- a/src/modules/raop/base64.c
+++ b/src/modules/raop/base64.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/raop/base64.h b/src/modules/raop/base64.h
index dac0e707..7a973b68 100644
--- a/src/modules/raop/base64.h
+++ b/src/modules/raop/base64.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/raop/raop_client.c b/src/modules/raop/raop_client.c
index 4627545e..b3f243c3 100644
--- a/src/modules/raop/raop_client.c
+++ b/src/modules/raop/raop_client.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
@@ -51,7 +51,12 @@
#include <pulsecore/macro.h>
#include <pulsecore/strbuf.h>
#include <pulsecore/random.h>
+
+#ifdef HAVE_POLL_H
+#include <poll.h>
+#else
#include <pulsecore/poll.h>
+#endif
#include "raop_client.h"
#include "rtsp_client.h"
@@ -339,9 +344,13 @@ static void rtsp_cb(pa_rtsp_client *rtsp, pa_rtsp_state state, pa_headerlist* he
break;
case STATE_TEARDOWN:
+ pa_log_debug("RAOP: TEARDOWN");
+ break;
+
case STATE_SET_PARAMETER:
pa_log_debug("RAOP: SET_PARAMETER");
break;
+
case STATE_DISCONNECTED:
pa_assert(c->closed_callback);
pa_assert(c->rtsp);
diff --git a/src/modules/raop/raop_client.h b/src/modules/raop/raop_client.h
index ec3136a7..5ad3e3fa 100644
--- a/src/modules/raop/raop_client.h
+++ b/src/modules/raop/raop_client.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/reserve-wrap.c b/src/modules/reserve-wrap.c
index 709cb060..7d339270 100644
--- a/src/modules/reserve-wrap.c
+++ b/src/modules/reserve-wrap.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/reserve-wrap.h b/src/modules/reserve-wrap.h
index 4625fe68..2b97c91c 100644
--- a/src/modules/reserve-wrap.h
+++ b/src/modules/reserve-wrap.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/reserve.h b/src/modules/reserve.h
index ceb1ad11..b315a08c 100644
--- a/src/modules/reserve.h
+++ b/src/modules/reserve.h
@@ -31,10 +31,11 @@
typedef struct rd_device rd_device;
/* Prototype for a function that is called whenever someone else wants
- * your app to release the device you having locked. A return value <=
- * 0 denies the request, a positive return value agrees to it. Before
- * returning your application should close the device in question
- * completely to make sure the new application may acceess it. */
+ * your application to release the device it has locked. A return
+ * value <= 0 denies the request, a positive return value agrees to
+ * it. Before returning your application should close the device in
+ * question completely to make sure the new application may access
+ * it. */
typedef int (*rd_request_cb_t)(
rd_device *d,
int forced); /* Non-zero if an application forcibly took the lock away without asking. If this is the case then the return value of this call is ignored. */
@@ -48,20 +49,20 @@ int rd_acquire(
const char *device_name, /* The device to lock, e.g. "Audio0" */
const char *application_name, /* A human readable name of the application, e.g. "PulseAudio Sound Server" */
int32_t priority, /* The priority for this application. If unsure use 0 */
- rd_request_cb_t request_cb, /* Will be called whenever someone asks that this device shall be released. May be NULL if priority is INT32_MAX */
+ rd_request_cb_t request_cb, /* Will be called whenever someone requests that this device shall be released. May be NULL if priority is INT32_MAX */
DBusError *error); /* If we fail due to a D-Bus related issue the error will be filled in here. May be NULL. */
-/* Unlock (if needed) and destroy a rd_device object again */
+/* Unlock (if needed) and destroy an rd_device object again */
void rd_release(rd_device *d);
-/* Set the application device name for a rd_device object Returns 0 on
- * success, a negative errno style return value on error. */
+/* Set the application device name for an rd_device object. Returns 0
+ * on success, a negative errno style return value on error. */
int rd_set_application_device_name(rd_device *d, const char *name);
-/* Attach a userdata pointer to a rd_device */
+/* Attach a userdata pointer to an rd_device */
void rd_set_userdata(rd_device *d, void *userdata);
-/* Query the userdata pointer from a rd_device. Returns NULL if no
+/* Query the userdata pointer from an rd_device. Returns NULL if no
* userdata was set. */
void* rd_get_userdata(rd_device *d);
diff --git a/src/modules/rtp/module-rtp-recv.c b/src/modules/rtp/module-rtp-recv.c
index 0d86459e..33e23af2 100644
--- a/src/modules/rtp/module-rtp-recv.c
+++ b/src/modules/rtp/module-rtp-recv.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/rtp/module-rtp-send.c b/src/modules/rtp/module-rtp-send.c
index fef745a1..722d12bd 100644
--- a/src/modules/rtp/module-rtp-send.c
+++ b/src/modules/rtp/module-rtp-send.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/rtp/rtp.c b/src/modules/rtp/rtp.c
index c09c321f..7537c1f5 100644
--- a/src/modules/rtp/rtp.c
+++ b/src/modules/rtp/rtp.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/rtp/rtp.h b/src/modules/rtp/rtp.h
index a2728f05..eff5e75b 100644
--- a/src/modules/rtp/rtp.h
+++ b/src/modules/rtp/rtp.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/rtp/rtsp_client.c b/src/modules/rtp/rtsp_client.c
index 9eb3d964..98db05dd 100644
--- a/src/modules/rtp/rtsp_client.c
+++ b/src/modules/rtp/rtsp_client.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
@@ -43,9 +43,14 @@
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
#include <pulsecore/strbuf.h>
-#include <pulsecore/poll.h>
#include <pulsecore/ioline.h>
+#ifdef HAVE_POLL_H
+#include <poll.h>
+#else
+#include <pulsecore/poll.h>
+#endif
+
#include "rtsp_client.h"
struct pa_rtsp_client {
@@ -101,26 +106,27 @@ pa_rtsp_client* pa_rtsp_client_new(pa_mainloop_api *mainloop, const char* hostna
void pa_rtsp_client_free(pa_rtsp_client* c) {
- if (c) {
- if (c->sc)
- pa_socket_client_unref(c->sc);
- if (c->ioline)
- pa_ioline_close(c->ioline);
- else if (c->io)
- pa_iochannel_free(c->io);
-
- pa_xfree(c->hostname);
- pa_xfree(c->url);
- pa_xfree(c->localip);
- pa_xfree(c->session);
- pa_xfree(c->transport);
- pa_xfree(c->last_header);
- if (c->header_buffer)
- pa_strbuf_free(c->header_buffer);
- if (c->response_headers)
- pa_headerlist_free(c->response_headers);
- pa_headerlist_free(c->headers);
- }
+ pa_assert(c);
+
+ if (c->sc)
+ pa_socket_client_unref(c->sc);
+ if (c->ioline)
+ pa_ioline_close(c->ioline);
+ else if (c->io)
+ pa_iochannel_free(c->io);
+
+ pa_xfree(c->hostname);
+ pa_xfree(c->url);
+ pa_xfree(c->localip);
+ pa_xfree(c->session);
+ pa_xfree(c->transport);
+ pa_xfree(c->last_header);
+ if (c->header_buffer)
+ pa_strbuf_free(c->header_buffer);
+ if (c->response_headers)
+ pa_headerlist_free(c->response_headers);
+ pa_headerlist_free(c->headers);
+
pa_xfree(c);
}
@@ -141,8 +147,6 @@ static void headers_read(pa_rtsp_client *c) {
c->transport = pa_xstrdup(pa_headerlist_gets(c->response_headers, "Transport"));
if (!c->session || !c->transport) {
- pa_headerlist_free(c->response_headers);
- c->response_headers = NULL;
pa_log("Invalid SETUP response.");
return;
}
@@ -160,8 +164,6 @@ static void headers_read(pa_rtsp_client *c) {
}
if (0 == c->rtp_port) {
/* Error no server_port in response */
- pa_headerlist_free(c->response_headers);
- c->response_headers = NULL;
pa_log("Invalid SETUP response (no port number).");
return;
}
@@ -169,9 +171,6 @@ static void headers_read(pa_rtsp_client *c) {
/* Call our callback */
c->callback(c, c->state, c->response_headers, c->userdata);
-
- pa_headerlist_free(c->response_headers);
- c->response_headers = NULL;
}
@@ -201,7 +200,8 @@ static void line_callback(pa_ioline *line, const char *s, void *userdata) {
}
if (c->waiting && 0 == strcmp("RTSP/1.0 200 OK", s2)) {
c->waiting = 0;
- pa_assert(!c->response_headers);
+ if (c->response_headers)
+ pa_headerlist_free(c->response_headers);
c->response_headers = pa_headerlist_new();
goto exit;
}
@@ -353,9 +353,12 @@ void pa_rtsp_set_callback(pa_rtsp_client *c, pa_rtsp_cb_t callback, void *userda
void pa_rtsp_disconnect(pa_rtsp_client *c) {
pa_assert(c);
- if (c->io)
+ if (c->ioline)
+ pa_ioline_close(c->ioline);
+ else if (c->io)
pa_iochannel_free(c->io);
c->io = NULL;
+ c->ioline = NULL;
}
diff --git a/src/modules/rtp/rtsp_client.h b/src/modules/rtp/rtsp_client.h
index 88fb3839..b229f261 100644
--- a/src/modules/rtp/rtsp_client.h
+++ b/src/modules/rtp/rtsp_client.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/rtp/sap.c b/src/modules/rtp/sap.c
index b5d9df62..adde16df 100644
--- a/src/modules/rtp/sap.c
+++ b/src/modules/rtp/sap.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/rtp/sap.h b/src/modules/rtp/sap.h
index 69c757cb..ae4ad426 100644
--- a/src/modules/rtp/sap.h
+++ b/src/modules/rtp/sap.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/rtp/sdp.c b/src/modules/rtp/sdp.c
index 7c547430..7fc7e38c 100644
--- a/src/modules/rtp/sdp.c
+++ b/src/modules/rtp/sdp.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/rtp/sdp.h b/src/modules/rtp/sdp.h
index 933a602b..4cb3b203 100644
--- a/src/modules/rtp/sdp.h
+++ b/src/modules/rtp/sdp.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/udev-util.c b/src/modules/udev-util.c
new file mode 100644
index 00000000..8ffb76a8
--- /dev/null
+++ b/src/modules/udev-util.c
@@ -0,0 +1,142 @@
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2009 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 <libudev.h>
+
+#include <pulse/xmalloc.h>
+#include <pulse/proplist.h>
+
+#include <pulsecore/log.h>
+#include <pulsecore/core-util.h>
+
+#include "udev-util.h"
+
+static int read_id(struct udev_device *d, const char *n) {
+ const char *v;
+ unsigned u;
+
+ pa_assert(d);
+ pa_assert(n);
+
+ if (!(v = udev_device_get_property_value(d, n)))
+ return -1;
+
+ if (pa_startswith(v, "0x"))
+ v += 2;
+
+ if (!*v)
+ return -1;
+
+ if (sscanf(v, "%04x", &u) != 1)
+ return -1;
+
+ if (u > 0xFFFFU)
+ return -1;
+
+ return u;
+}
+
+int pa_udev_get_info(pa_core *core, pa_proplist *p, int card_idx) {
+ int r = -1;
+ struct udev *udev;
+ struct udev_device *card;
+ char *t;
+ const char *v;
+ int id;
+
+ pa_assert(core);
+ pa_assert(p);
+ pa_assert(card_idx >= 0);
+
+ if (!(udev = udev_new())) {
+ pa_log_error("Failed to allocate udev context.");
+ goto finish;
+ }
+
+ t = pa_sprintf_malloc("%s/class/sound/card%i", udev_get_sys_path(udev), card_idx);
+ card = udev_device_new_from_syspath(udev, t);
+ pa_xfree(t);
+
+ if (!card) {
+ pa_log_error("Failed to get card object.");
+ goto finish;
+ }
+
+ if (!pa_proplist_contains(p, PA_PROP_DEVICE_BUS))
+ if ((v = udev_device_get_property_value(card, "ID_BUS")) && *v)
+ pa_proplist_sets(p, PA_PROP_DEVICE_BUS, v);
+
+ if (!pa_proplist_contains(p, PA_PROP_DEVICE_VENDOR_ID))
+ if ((id = read_id(card, "ID_VENDOR_ID")) > 0 && *v)
+ pa_proplist_setf(p, PA_PROP_DEVICE_VENDOR_ID, "%04x", id);
+
+ if (!pa_proplist_contains(p, PA_PROP_DEVICE_VENDOR_NAME)) {
+ if ((v = udev_device_get_property_value(card, "ID_VENDOR_FROM_DATABASE")) && *v)
+ pa_proplist_sets(p, PA_PROP_DEVICE_VENDOR_NAME, v);
+ else if ((v = udev_device_get_property_value(card, "ID_VENDOR")) && *v)
+ pa_proplist_sets(p, PA_PROP_DEVICE_VENDOR_NAME, v);
+ }
+
+ if (!pa_proplist_contains(p, PA_PROP_DEVICE_PRODUCT_ID))
+ if ((id = read_id(card, "ID_MODEL_ID")) >= 0)
+ pa_proplist_setf(p, PA_PROP_DEVICE_PRODUCT_ID, "%04x", id);
+
+ if (!pa_proplist_contains(p, PA_PROP_DEVICE_PRODUCT_NAME)) {
+ if ((v = udev_device_get_property_value(card, "ID_MODEL_FROM_DATABASE")) && *v)
+ pa_proplist_sets(p, PA_PROP_DEVICE_PRODUCT_NAME, v);
+ else if ((v = udev_device_get_property_value(card, "ID_MODEL")) && *v)
+ pa_proplist_sets(p, PA_PROP_DEVICE_PRODUCT_NAME, v);
+ }
+
+ if (!pa_proplist_contains(p, PA_PROP_DEVICE_SERIAL))
+ if ((v = udev_device_get_property_value(card, "ID_SERIAL")) && *v)
+ pa_proplist_sets(p, PA_PROP_DEVICE_SERIAL, v);
+
+ if (!pa_proplist_contains(p, PA_PROP_DEVICE_FORM_FACTOR))
+ if ((v = udev_device_get_property_value(card, "SOUND_FORM_FACTOR")) && *v)
+ pa_proplist_sets(p, PA_PROP_DEVICE_FORM_FACTOR, v);
+
+ if (!pa_proplist_contains(p, PA_PROP_DEVICE_BUS_PATH))
+ if ((v = udev_device_get_devpath(card)))
+ pa_proplist_sets(p, PA_PROP_DEVICE_BUS_PATH, v);
+
+ /* This is normaly not set by th udev rules but may be useful to
+ * allow administrators to overwrite the device description.*/
+ if (!pa_proplist_contains(p, PA_PROP_DEVICE_DESCRIPTION))
+ if ((v = udev_device_get_property_value(card, "SOUND_DESCRIPTION")) && *v)
+ pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, v);
+
+ r = 0;
+
+finish:
+
+ if (card)
+ udev_device_unref(card);
+
+ if (udev)
+ udev_unref(udev);
+
+ return r;
+}
diff --git a/src/modules/udev-util.h b/src/modules/udev-util.h
new file mode 100644
index 00000000..5120abdd
--- /dev/null
+++ b/src/modules/udev-util.h
@@ -0,0 +1,30 @@
+#ifndef fooudevutilhfoo
+#define fooudevutilhfoo
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2009 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 <pulsecore/core.h>
+
+int pa_udev_get_info(pa_core *core, pa_proplist *p, int card);
+
+#endif
diff --git a/src/pulse/browser.c b/src/pulse/browser.c
index 1a3f657f..4cf5d0c3 100644
--- a/src/pulse/browser.c
+++ b/src/pulse/browser.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/pulse/browser.h b/src/pulse/browser.h
index 499fae2e..c843e2a2 100644
--- a/src/pulse/browser.h
+++ b/src/pulse/browser.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/pulse/cdecl.h b/src/pulse/cdecl.h
index 8c5b2d0f..dd0d14f7 100644
--- a/src/pulse/cdecl.h
+++ b/src/pulse/cdecl.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/pulse/channelmap.c b/src/pulse/channelmap.c
index 82e36c00..ce7dadc9 100644
--- a/src/pulse/channelmap.c
+++ b/src/pulse/channelmap.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/pulse/channelmap.h b/src/pulse/channelmap.h
index a6d37d85..eef0ac17 100644
--- a/src/pulse/channelmap.h
+++ b/src/pulse/channelmap.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/pulse/client-conf-x11.c b/src/pulse/client-conf-x11.c
index a8a90fb8..3bec742f 100644
--- a/src/pulse/client-conf-x11.c
+++ b/src/pulse/client-conf-x11.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/pulse/client-conf-x11.h b/src/pulse/client-conf-x11.h
index f2f40e03..dca9f0d2 100644
--- a/src/pulse/client-conf-x11.h
+++ b/src/pulse/client-conf-x11.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/pulse/client-conf.c b/src/pulse/client-conf.c
index 71f8443d..58bc3f90 100644
--- a/src/pulse/client-conf.c
+++ b/src/pulse/client-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
diff --git a/src/pulse/client-conf.h b/src/pulse/client-conf.h
index 4eac467e..78844a12 100644
--- a/src/pulse/client-conf.h
+++ b/src/pulse/client-conf.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/pulse/context.c b/src/pulse/context.c
index 62fe5356..00dffc25 100644
--- a/src/pulse/context.c
+++ b/src/pulse/context.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
@@ -74,6 +74,7 @@
#include "internal.h"
#include "client-conf.h"
+#include "fork-detect.h"
#ifdef HAVE_X11
#include "client-conf-x11.h"
@@ -127,6 +128,9 @@ pa_context *pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char *
pa_assert(mainloop);
+ if (pa_detect_fork())
+ return NULL;
+
pa_init_i18n();
c = pa_xnew(pa_context, 1);
@@ -822,6 +826,7 @@ int pa_context_connect(
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY(c, c->state == PA_CONTEXT_UNCONNECTED, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY(c, !(flags & ~PA_CONTEXT_NOAUTOSPAWN), PA_ERR_INVALID);
PA_CHECK_VALIDITY(c, !server || *server, PA_ERR_INVALID);
@@ -894,6 +899,9 @@ void pa_context_disconnect(pa_context *c) {
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ if (pa_detect_fork())
+ return;
+
if (PA_CONTEXT_IS_GOOD(c->state))
pa_context_set_state(c, PA_CONTEXT_TERMINATED);
}
@@ -916,6 +924,9 @@ void pa_context_set_state_callback(pa_context *c, pa_context_notify_cb_t cb, voi
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ if (pa_detect_fork())
+ return;
+
if (c->state == PA_CONTEXT_TERMINATED || c->state == PA_CONTEXT_FAILED)
return;
@@ -927,6 +938,9 @@ void pa_context_set_event_callback(pa_context *c, pa_context_event_cb_t cb, void
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ if (pa_detect_fork())
+ return;
+
if (c->state == PA_CONTEXT_TERMINATED || c->state == PA_CONTEXT_FAILED)
return;
@@ -938,6 +952,7 @@ int pa_context_is_pending(pa_context *c) {
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY(c, PA_CONTEXT_IS_GOOD(c->state), PA_ERR_BADSTATE);
return (c->pstream && pa_pstream_is_pending(c->pstream)) ||
@@ -994,6 +1009,7 @@ pa_operation* pa_context_drain(pa_context *c, pa_context_notify_cb_t cb, void *u
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, pa_context_is_pending(c), PA_ERR_BADSTATE);
@@ -1042,6 +1058,7 @@ pa_operation* pa_context_send_simple_command(pa_context *c, uint32_t command, pa
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
o = pa_operation_new(c, NULL, cb, userdata);
@@ -1068,6 +1085,7 @@ pa_operation* pa_context_set_default_sink(pa_context *c, const char *name, pa_co
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
o = pa_operation_new(c, NULL, (pa_operation_cb_t) cb, userdata);
@@ -1087,6 +1105,7 @@ pa_operation* pa_context_set_default_source(pa_context *c, const char *name, pa_
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
o = pa_operation_new(c, NULL, (pa_operation_cb_t) cb, userdata);
@@ -1102,6 +1121,7 @@ int pa_context_is_local(pa_context *c) {
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_ANY(c, !pa_detect_fork(), PA_ERR_FORKED, -1);
PA_CHECK_VALIDITY_RETURN_ANY(c, PA_CONTEXT_IS_GOOD(c->state), PA_ERR_BADSTATE, -1);
return !!c->is_local;
@@ -1114,6 +1134,7 @@ pa_operation* pa_context_set_name(pa_context *c, const char *name, pa_context_su
pa_assert(PA_REFCNT_VALUE(c) >= 1);
pa_assert(name);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
if (c->version >= 13) {
@@ -1144,8 +1165,8 @@ const char* pa_context_get_server(pa_context *c) {
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
- if (!c->server)
- return NULL;
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, c->server, PA_ERR_NOENTITY);
if (*c->server == '{') {
char *e = strchr(c->server+1, '}');
@@ -1163,6 +1184,7 @@ uint32_t pa_context_get_server_protocol_version(pa_context *c) {
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_ANY(c, !pa_detect_fork(), PA_ERR_FORKED, PA_INVALID_INDEX);
PA_CHECK_VALIDITY_RETURN_ANY(c, PA_CONTEXT_IS_GOOD(c->state), PA_ERR_BADSTATE, PA_INVALID_INDEX);
return c->version;
@@ -1185,6 +1207,7 @@ uint32_t pa_context_get_index(pa_context *c) {
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_ANY(c, !pa_detect_fork(), PA_ERR_FORKED, PA_INVALID_INDEX);
PA_CHECK_VALIDITY_RETURN_ANY(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE, PA_INVALID_INDEX);
PA_CHECK_VALIDITY_RETURN_ANY(c, c->version >= 13, PA_ERR_NOTSUPPORTED, PA_INVALID_INDEX);
@@ -1199,6 +1222,7 @@ pa_operation *pa_context_proplist_update(pa_context *c, pa_update_mode_t mode, p
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, mode == PA_UPDATE_SET || mode == PA_UPDATE_MERGE || mode == PA_UPDATE_REPLACE, PA_ERR_INVALID);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 13, PA_ERR_NOTSUPPORTED);
@@ -1227,6 +1251,7 @@ pa_operation *pa_context_proplist_remove(pa_context *c, const char *const keys[]
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, keys && keys[0], PA_ERR_INVALID);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 13, PA_ERR_NOTSUPPORTED);
diff --git a/src/pulse/context.h b/src/pulse/context.h
index 2ae4c013..c32cf443 100644
--- a/src/pulse/context.h
+++ b/src/pulse/context.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/pulse/def.h b/src/pulse/def.h
index 7f3a0c5d..3629aabc 100644
--- a/src/pulse/def.h
+++ b/src/pulse/def.h
@@ -389,6 +389,7 @@ enum {
PA_ERR_NOEXTENSION, /**< Extension does not exist. \since 0.9.12 */
PA_ERR_OBSOLETE, /**< Obsolete functionality. \since 0.9.15 */
PA_ERR_NOTIMPLEMENTED, /**< Missing implementation. \since 0.9.15 */
+ PA_ERR_FORKED, /**< The caler forked without calling execve() and tried to reuse the context. \since 0.9.15 */
PA_ERR_MAX /**< Not really an error but the first invalid error code */
};
@@ -417,6 +418,7 @@ enum {
#define PA_ERR_NOEXTENSION PA_ERR_NOEXTENSION
#define PA_ERR_OBSOLETE PA_ERR_OBSOLETE
#define PA_ERR_NOTIMPLEMENTED PA_ERR_NOTIMPLEMENTED
+#define PA_ERR_FORKED PA_ERR_FORKED
#define PA_ERR_MAX PA_ERR_MAX
/** \endcond */
diff --git a/src/pulse/error.c b/src/pulse/error.c
index d37084bb..93a13fc6 100644
--- a/src/pulse/error.c
+++ b/src/pulse/error.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
@@ -63,12 +63,16 @@ const char*pa_strerror(int error) {
[PA_ERR_UNKNOWN] = N_("Unknown error code"),
[PA_ERR_NOEXTENSION] = N_("No such extension"),
[PA_ERR_OBSOLETE] = N_("Obsolete functionality"),
- [PA_ERR_NOTIMPLEMENTED] = N_("Missing implementation")
+ [PA_ERR_NOTIMPLEMENTED] = N_("Missing implementation"),
+ [PA_ERR_FORKED] = N_("Client forked")
};
pa_init_i18n();
- if (error < 0 || error >= PA_ERR_MAX)
+ if (error < 0)
+ error = -error;
+
+ if (error >= PA_ERR_MAX)
return NULL;
return _(errortab[error]);
diff --git a/src/pulse/error.h b/src/pulse/error.h
index c30b80bd..ea535608 100644
--- a/src/pulse/error.h
+++ b/src/pulse/error.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/pulse/ext-stream-restore.c b/src/pulse/ext-stream-restore.c
index 469c822a..63c911f8 100644
--- a/src/pulse/ext-stream-restore.c
+++ b/src/pulse/ext-stream-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
@@ -31,6 +31,7 @@
#include "internal.h"
#include "operation.h"
+#include "fork-detect.h"
#include "ext-stream-restore.h"
@@ -87,6 +88,7 @@ pa_operation *pa_ext_stream_restore_test(
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 14, PA_ERR_NOTSUPPORTED);
@@ -167,6 +169,7 @@ pa_operation *pa_ext_stream_restore_read(
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 14, PA_ERR_NOTSUPPORTED);
@@ -200,6 +203,7 @@ pa_operation *pa_ext_stream_restore_write(
pa_assert(mode == PA_UPDATE_MERGE || mode == PA_UPDATE_REPLACE || mode == PA_UPDATE_SET);
pa_assert(data);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 14, PA_ERR_NOTSUPPORTED);
@@ -262,6 +266,7 @@ pa_operation *pa_ext_stream_restore_delete(
pa_assert(PA_REFCNT_VALUE(c) >= 1);
pa_assert(s);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 14, PA_ERR_NOTSUPPORTED);
@@ -310,6 +315,7 @@ pa_operation *pa_ext_stream_restore_subscribe(
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 14, PA_ERR_NOTSUPPORTED);
@@ -334,6 +340,9 @@ void pa_ext_stream_restore_set_subscribe_cb(
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ if (pa_detect_fork())
+ return;
+
c->ext_stream_restore.callback = cb;
c->ext_stream_restore.userdata = userdata;
}
diff --git a/src/pulse/ext-stream-restore.h b/src/pulse/ext-stream-restore.h
index cf9f4ccc..0b5d8eb6 100644
--- a/src/pulse/ext-stream-restore.h
+++ b/src/pulse/ext-stream-restore.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/pulse/fork-detect.c b/src/pulse/fork-detect.c
new file mode 100644
index 00000000..f10fc029
--- /dev/null
+++ b/src/pulse/fork-detect.c
@@ -0,0 +1,59 @@
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2009 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 <unistd.h>
+
+#include <pulsecore/atomic.h>
+#include <pulsecore/macro.h>
+
+#include "fork-detect.h"
+
+int pa_detect_fork(void) {
+ static pa_atomic_t pid = PA_ATOMIC_INIT((int) -1);
+
+ /* Some really stupid applications (Hey, vim, that means you!)
+ * love to fork after initializing
+ * gtk/libcanberra/pulseaudio. This is really bad style. We
+ * however have to deal with this cleanly, so we try to detect the
+ * forks making sure all our calls fail cleanly after the fork. */
+
+ pa_assert(sizeof(pa_atomic_t) >= sizeof(pid_t));
+
+ for (;;) {
+ pid_t stored_pid = (pid_t) pa_atomic_load(&pid);
+
+ /* First let's check whether the current pid matches the stored one */
+ if (stored_pid == getpid())
+ return FALSE;
+
+ /* Does it contain a different PID than ours? Then the process got forked. */
+ if ((int) stored_pid != (int) -1)
+ return TRUE;
+
+ /* Ok, it still contains no PID, then store it */
+ if (pa_atomic_cmpxchg(&pid, (int) -1, (int) getpid()))
+ return FALSE;
+ }
+}
diff --git a/src/pulse/fork-detect.h b/src/pulse/fork-detect.h
new file mode 100644
index 00000000..649d9818
--- /dev/null
+++ b/src/pulse/fork-detect.h
@@ -0,0 +1,27 @@
+#ifndef fooforkdetecthfoo
+#define fooforkdetecthfoo
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2009 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.
+***/
+
+int pa_detect_fork(void);
+
+#endif
diff --git a/src/pulse/gccmacro.h b/src/pulse/gccmacro.h
index 58188ee2..e85ecb66 100644
--- a/src/pulse/gccmacro.h
+++ b/src/pulse/gccmacro.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/pulse/glib-mainloop.c b/src/pulse/glib-mainloop.c
index 5f5dc494..6afb7a2d 100644
--- a/src/pulse/glib-mainloop.c
+++ b/src/pulse/glib-mainloop.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/pulse/glib-mainloop.h b/src/pulse/glib-mainloop.h
index fd68f8ac..189513a8 100644
--- a/src/pulse/glib-mainloop.h
+++ b/src/pulse/glib-mainloop.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/pulse/internal.h b/src/pulse/internal.h
index e533625d..9646d8a6 100644
--- a/src/pulse/internal.h
+++ b/src/pulse/internal.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/pulse/introspect.c b/src/pulse/introspect.c
index befeb242..ac8a11aa 100644
--- a/src/pulse/introspect.c
+++ b/src/pulse/introspect.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
@@ -35,6 +35,7 @@
#include <pulsecore/pstream-util.h>
#include "internal.h"
+#include "fork-detect.h"
#include "introspect.h"
@@ -232,6 +233,7 @@ pa_operation* pa_context_get_sink_info_by_index(pa_context *c, uint32_t idx, pa_
pa_assert(PA_REFCNT_VALUE(c) >= 1);
pa_assert(cb);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
o = pa_operation_new(c, NULL, (pa_operation_cb_t) cb, userdata);
@@ -254,6 +256,7 @@ pa_operation* pa_context_get_sink_info_by_name(pa_context *c, const char *name,
pa_assert(PA_REFCNT_VALUE(c) >= 1);
pa_assert(cb);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, !name || *name, PA_ERR_INVALID);
@@ -365,6 +368,7 @@ pa_operation* pa_context_get_source_info_by_index(pa_context *c, uint32_t idx, p
pa_assert(PA_REFCNT_VALUE(c) >= 1);
pa_assert(cb);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
o = pa_operation_new(c, NULL, (pa_operation_cb_t) cb, userdata);
@@ -387,6 +391,7 @@ pa_operation* pa_context_get_source_info_by_name(pa_context *c, const char *name
pa_assert(PA_REFCNT_VALUE(c) >= 1);
pa_assert(cb);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, !name || *name, PA_ERR_INVALID);
@@ -466,6 +471,7 @@ pa_operation* pa_context_get_client_info(pa_context *c, uint32_t idx, pa_client_
pa_assert(PA_REFCNT_VALUE(c) >= 1);
pa_assert(cb);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
@@ -528,7 +534,8 @@ static void context_get_card_info_callback(pa_pdispatch *pd, uint32_t command, u
if (pa_tagstruct_gets(t, &i.profiles[j].name) < 0 ||
pa_tagstruct_gets(t, &i.profiles[j].description) < 0 ||
pa_tagstruct_getu32(t, &i.profiles[j].n_sinks) < 0 ||
- pa_tagstruct_getu32(t, &i.profiles[j].n_sources)< 0) {
+ pa_tagstruct_getu32(t, &i.profiles[j].n_sources) < 0 ||
+ pa_tagstruct_getu32(t, &i.profiles[j].priority) < 0) {
pa_context_fail(o->context, PA_ERR_PROTOCOL);
pa_xfree(i.profiles);
@@ -589,6 +596,7 @@ pa_operation* pa_context_get_card_info_by_index(pa_context *c, uint32_t idx, pa_
pa_assert(PA_REFCNT_VALUE(c) >= 1);
pa_assert(cb);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 15, PA_ERR_NOTSUPPORTED);
@@ -613,6 +621,7 @@ pa_operation* pa_context_get_card_info_by_name(pa_context *c, const char*name, p
pa_assert(PA_REFCNT_VALUE(c) >= 1);
pa_assert(cb);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, !name || *name, PA_ERR_INVALID);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 15, PA_ERR_NOTSUPPORTED);
@@ -640,6 +649,7 @@ pa_operation* pa_context_set_card_profile_by_index(pa_context *c, uint32_t idx,
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 15, PA_ERR_NOTSUPPORTED);
@@ -664,6 +674,7 @@ pa_operation* pa_context_set_card_profile_by_name(pa_context *c, const char *nam
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, !name || *name, PA_ERR_INVALID);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 15, PA_ERR_NOTSUPPORTED);
@@ -747,6 +758,7 @@ pa_operation* pa_context_get_module_info(pa_context *c, uint32_t idx, pa_module_
pa_assert(PA_REFCNT_VALUE(c) >= 1);
pa_assert(cb);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
@@ -841,6 +853,7 @@ pa_operation* pa_context_get_sink_input_info(pa_context *c, uint32_t idx, pa_sin
pa_assert(PA_REFCNT_VALUE(c) >= 1);
pa_assert(cb);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
@@ -930,6 +943,7 @@ pa_operation* pa_context_get_source_output_info(pa_context *c, uint32_t idx, pa_
pa_assert(PA_REFCNT_VALUE(c) >= 1);
pa_assert(cb);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
@@ -958,6 +972,7 @@ pa_operation* pa_context_set_sink_volume_by_index(pa_context *c, uint32_t idx, c
pa_assert(PA_REFCNT_VALUE(c) >= 1);
pa_assert(volume);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, pa_cvolume_valid(volume), PA_ERR_INVALID);
@@ -983,6 +998,7 @@ pa_operation* pa_context_set_sink_volume_by_name(pa_context *c, const char *name
pa_assert(name);
pa_assert(volume);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, pa_cvolume_valid(volume), PA_ERR_INVALID);
PA_CHECK_VALIDITY_RETURN_NULL(c, !name || *name, PA_ERR_INVALID);
@@ -1007,6 +1023,7 @@ pa_operation* pa_context_set_sink_mute_by_index(pa_context *c, uint32_t idx, int
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
o = pa_operation_new(c, NULL, (pa_operation_cb_t) cb, userdata);
@@ -1030,6 +1047,7 @@ pa_operation* pa_context_set_sink_mute_by_name(pa_context *c, const char *name,
pa_assert(PA_REFCNT_VALUE(c) >= 1);
pa_assert(name);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, !name || *name, PA_ERR_INVALID);
@@ -1054,6 +1072,7 @@ pa_operation* pa_context_set_sink_input_volume(pa_context *c, uint32_t idx, cons
pa_assert(PA_REFCNT_VALUE(c) >= 1);
pa_assert(volume);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
PA_CHECK_VALIDITY_RETURN_NULL(c, pa_cvolume_valid(volume), PA_ERR_INVALID);
@@ -1077,6 +1096,7 @@ pa_operation* pa_context_set_sink_input_mute(pa_context *c, uint32_t idx, int mu
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 11, PA_ERR_NOTSUPPORTED);
@@ -1101,6 +1121,7 @@ pa_operation* pa_context_set_source_volume_by_index(pa_context *c, uint32_t idx,
pa_assert(PA_REFCNT_VALUE(c) >= 1);
pa_assert(volume);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, pa_cvolume_valid(volume), PA_ERR_INVALID);
@@ -1126,6 +1147,7 @@ pa_operation* pa_context_set_source_volume_by_name(pa_context *c, const char *na
pa_assert(name);
pa_assert(volume);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, pa_cvolume_valid(volume), PA_ERR_INVALID);
PA_CHECK_VALIDITY_RETURN_NULL(c, !name || *name, PA_ERR_INVALID);
@@ -1150,6 +1172,7 @@ pa_operation* pa_context_set_source_mute_by_index(pa_context *c, uint32_t idx, i
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
o = pa_operation_new(c, NULL, (pa_operation_cb_t) cb, userdata);
@@ -1173,6 +1196,7 @@ pa_operation* pa_context_set_source_mute_by_name(pa_context *c, const char *name
pa_assert(PA_REFCNT_VALUE(c) >= 1);
pa_assert(name);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, !name || *name, PA_ERR_INVALID);
@@ -1260,6 +1284,7 @@ pa_operation* pa_context_get_sample_info_by_name(pa_context *c, const char *name
pa_assert(PA_REFCNT_VALUE(c) >= 1);
pa_assert(cb);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, name && *name, PA_ERR_INVALID);
@@ -1283,6 +1308,7 @@ pa_operation* pa_context_get_sample_info_by_index(pa_context *c, uint32_t idx, p
pa_assert(PA_REFCNT_VALUE(c) >= 1);
pa_assert(cb);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
@@ -1309,6 +1335,7 @@ static pa_operation* command_kill(pa_context *c, uint32_t command, uint32_t idx,
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
@@ -1375,6 +1402,7 @@ pa_operation* pa_context_load_module(pa_context *c, const char*name, const char
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, name && *name, PA_ERR_INVALID);
@@ -1458,6 +1486,7 @@ pa_operation* pa_context_move_sink_input_by_name(pa_context *c, uint32_t idx, co
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 10, PA_ERR_NOTSUPPORTED);
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
@@ -1483,6 +1512,7 @@ pa_operation* pa_context_move_sink_input_by_index(pa_context *c, uint32_t idx, u
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 10, PA_ERR_NOTSUPPORTED);
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
@@ -1508,6 +1538,7 @@ pa_operation* pa_context_move_source_output_by_name(pa_context *c, uint32_t idx,
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 10, PA_ERR_NOTSUPPORTED);
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
@@ -1533,6 +1564,7 @@ pa_operation* pa_context_move_source_output_by_index(pa_context *c, uint32_t idx
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 10, PA_ERR_NOTSUPPORTED);
PA_CHECK_VALIDITY_RETURN_NULL(c, idx != PA_INVALID_INDEX, PA_ERR_INVALID);
@@ -1558,6 +1590,7 @@ pa_operation* pa_context_suspend_sink_by_name(pa_context *c, const char *sink_na
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 11, PA_ERR_NOTSUPPORTED);
PA_CHECK_VALIDITY_RETURN_NULL(c, !sink_name || *sink_name, PA_ERR_INVALID);
@@ -1582,6 +1615,7 @@ pa_operation* pa_context_suspend_sink_by_index(pa_context *c, uint32_t idx, int
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 11, PA_ERR_NOTSUPPORTED);
@@ -1605,6 +1639,7 @@ pa_operation* pa_context_suspend_source_by_name(pa_context *c, const char *sourc
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 11, PA_ERR_NOTSUPPORTED);
PA_CHECK_VALIDITY_RETURN_NULL(c, !source_name || *source_name, PA_ERR_INVALID);
@@ -1629,6 +1664,7 @@ pa_operation* pa_context_suspend_source_by_index(pa_context *c, uint32_t idx, in
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 11, PA_ERR_NOTSUPPORTED);
diff --git a/src/pulse/introspect.h b/src/pulse/introspect.h
index aa67e43d..ec8a2c06 100644
--- a/src/pulse/introspect.h
+++ b/src/pulse/introspect.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
@@ -401,6 +401,7 @@ typedef struct pa_card_profile_info {
const char *description; /**< Description of this profile */
uint32_t n_sinks; /**< Number of sinks this profile would create */
uint32_t n_sources; /**< Number of sources this profile would create */
+ uint32_t priority; /**< The higher this value is the more useful this profile is as a default */
} pa_card_profile_info;
/** Stores information about cards. Please note that this structure
diff --git a/src/pulse/mainloop-signal.c b/src/pulse/mainloop-signal.c
index d09f4b0a..52f11c80 100644
--- a/src/pulse/mainloop-signal.c
+++ b/src/pulse/mainloop-signal.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/pulse/mainloop-signal.h b/src/pulse/mainloop-signal.h
index a9e250bc..fdb1f9db 100644
--- a/src/pulse/mainloop-signal.h
+++ b/src/pulse/mainloop-signal.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/pulse/mainloop.c b/src/pulse/mainloop.c
index 60e5d1ff..225fd098 100644
--- a/src/pulse/mainloop.c
+++ b/src/pulse/mainloop.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/pulse/mainloop.h b/src/pulse/mainloop.h
index 907e94a7..3a03ac9a 100644
--- a/src/pulse/mainloop.h
+++ b/src/pulse/mainloop.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/pulse/operation.c b/src/pulse/operation.c
index aa2bbc05..fe160a3c 100644
--- a/src/pulse/operation.c
+++ b/src/pulse/operation.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/pulse/operation.h b/src/pulse/operation.h
index b68e7816..7b0dabdd 100644
--- a/src/pulse/operation.h
+++ b/src/pulse/operation.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/pulse/proplist.h b/src/pulse/proplist.h
index d30dc3b9..d5f5bc04 100644
--- a/src/pulse/proplist.h
+++ b/src/pulse/proplist.h
@@ -45,8 +45,10 @@ PA_C_DECL_BEGIN
/** For streams: source filename if applicable, in URI format or local path. e.g. "/home/lennart/music/foobar.ogg" */
#define PA_PROP_MEDIA_FILENAME "media.filename"
+/** \cond fulldocs */
/** For streams: icon for the media. A binary blob containing PNG image data */
#define PA_PROP_MEDIA_ICON "media.icon"
+/** \endcond */
/** For streams: an XDG icon name for the media. e.g. "audio-x-mp3" */
#define PA_PROP_MEDIA_ICON_NAME "media.icon_name"
@@ -81,8 +83,10 @@ PA_C_DECL_BEGIN
/** For streams that belong to a window on the screen: a textual id for identifying a window logically. e.g. "org.gnome.Totem.MainWindow" */
#define PA_PROP_WINDOW_ID "window.id"
+/** \cond fulldocs */
/** For streams that belong to a window on the screen: window icon. A binary blob containing PNG image data */
#define PA_PROP_WINDOW_ICON "window.icon"
+/** \endcond */
/** For streams that belong to a window on the screen: an XDG icon name for the window. e.g. "totem" */
#define PA_PROP_WINDOW_ICON_NAME "window.icon_name"
@@ -108,8 +112,10 @@ PA_C_DECL_BEGIN
/** For clients/streams: a version string e.g. "0.6.88" */
#define PA_PROP_APPLICATION_VERSION "application.version"
+/** \cond fulldocs */
/** For clients/streams: application icon. A binary blob containing PNG image data */
#define PA_PROP_APPLICATION_ICON "application.icon"
+/** \endcond */
/** For clients/streams: an XDG icon name for the application. e.g. "totem" */
#define PA_PROP_APPLICATION_ICON_NAME "application.icon_name"
@@ -150,17 +156,34 @@ PA_C_DECL_BEGIN
/** For devices: serial number if applicable. e.g. "4711-0815-1234" */
#define PA_PROP_DEVICE_SERIAL "device.serial"
-/** For devices: vendor/product ID if applicable. e.g. 1274:1371 */
-#define PA_PROP_DEVICE_VENDOR_PRODUCT_ID "device.vendor_product_id"
+/** For devices: vendor ID if applicable. e.g. 1274 */
+#define PA_PROP_DEVICE_VENDOR_ID "device.vendor.id"
+
+/** For devices: vendor name if applicable. e.g. "Foocorp Heavy Industries" */
+#define PA_PROP_DEVICE_VENDOR_NAME "device.vendor.name"
+
+/** For devices: product ID if applicable. e.g. 4565 */
+#define PA_PROP_DEVICE_PRODUCT_ID "device.product.id"
+
+/** For devices: product name if applicable. e.g. "SuperSpeakers 2000 Pro" */
+#define PA_PROP_DEVICE_PRODUCT_NAME "device.product.name"
/** For devices: device class. One of "sound", "modem", "monitor", "filter" */
#define PA_PROP_DEVICE_CLASS "device.class"
-/** For devices: form factor if applicable. One of "laptop-speakers", "external-speakers", "telephone", "tv-capture", "webcam-capture", "microphone-capture", "headset", "headphones", "hands-free", "car", "hifi", "computer", "portable" */
+/** For devices: form factor if applicable. One of "internal", "speaker", "handset", "tv", "webcam", "microphone", "headset", "headphone", "hands-free", "car", "hifi", "computer", "portable" */
#define PA_PROP_DEVICE_FORM_FACTOR "device.form_factor"
-/** For devices: connector of the device if applicable. One of "isa", "pci", "usb", "firewire", "bluetooth" */
-#define PA_PROP_DEVICE_CONNECTOR "device.connector"
+/** For devices: bus of the device if applicable. One of "isa", "pci", "usb", "firewire", "bluetooth" */
+#define PA_PROP_DEVICE_BUS "device.bus"
+
+/** \cond fulldocs */
+/** For devices: icon for the device. A binary blob containing PNG image data */
+#define PA_PROP_DEVICE_ICON "device.icon"
+/** \endcond */
+
+/** For devices: an XDG icon name for the device. e.g. "sound-card-speakers-usb" */
+#define PA_PROP_DEVICE_ICON_NAME "device.icon_name"
/** For devices: access mode of the device if applicable. One of "mmap", "mmap_rewrite", "serial" */
#define PA_PROP_DEVICE_ACCESS_MODE "device.access_mode"
diff --git a/src/pulse/sample.c b/src/pulse/sample.c
index 4b13a337..1e67b037 100644
--- a/src/pulse/sample.c
+++ b/src/pulse/sample.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/pulse/sample.h b/src/pulse/sample.h
index 3c05b54a..aef34b6b 100644
--- a/src/pulse/sample.h
+++ b/src/pulse/sample.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/pulse/scache.c b/src/pulse/scache.c
index a7e3cd81..77f60d72 100644
--- a/src/pulse/scache.c
+++ b/src/pulse/scache.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/pulse/scache.h b/src/pulse/scache.h
index 79fcfbc5..cd579d2e 100644
--- a/src/pulse/scache.h
+++ b/src/pulse/scache.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/pulse/simple.c b/src/pulse/simple.c
index 79e39ebb..e70b7b1f 100644
--- a/src/pulse/simple.c
+++ b/src/pulse/simple.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/pulse/simple.h b/src/pulse/simple.h
index 3f57a654..6f1ba414 100644
--- a/src/pulse/simple.h
+++ b/src/pulse/simple.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/pulse/stream.c b/src/pulse/stream.c
index b36bf9b1..9a0ea0fd 100644
--- a/src/pulse/stream.c
+++ b/src/pulse/stream.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
@@ -38,6 +38,7 @@
#include <pulsecore/macro.h>
#include <pulsecore/rtclock.h>
+#include "fork-detect.h"
#include "internal.h"
#define LATENCY_IPOL_INTERVAL_USEC (333*PA_USEC_PER_MSEC)
@@ -87,6 +88,7 @@ pa_stream *pa_stream_new_with_proplist(
pa_assert(c);
pa_assert(PA_REFCNT_VALUE(c) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(c, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(c, ss && pa_sample_spec_valid(ss), PA_ERR_INVALID);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 12 || (ss->format != PA_SAMPLE_S32LE && ss->format != PA_SAMPLE_S32BE), PA_ERR_NOTSUPPORTED);
PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 15 || (ss->format != PA_SAMPLE_S24LE && ss->format != PA_SAMPLE_S24BE), PA_ERR_NOTSUPPORTED);
@@ -267,6 +269,7 @@ uint32_t pa_stream_get_index(pa_stream *s) {
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY_RETURN_ANY(s->context, !pa_detect_fork(), PA_ERR_FORKED, PA_INVALID_INDEX);
PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE, PA_INVALID_INDEX);
return s->stream_index;
@@ -921,6 +924,7 @@ static int create_stream(
pa_assert(PA_REFCNT_VALUE(s) >= 1);
pa_assert(direction == PA_STREAM_PLAYBACK || direction == PA_STREAM_RECORD);
+ PA_CHECK_VALIDITY(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_UNCONNECTED, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY(s->context, s->direct_on_input == PA_INVALID_INDEX || direction == PA_STREAM_RECORD, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY(s->context, !(flags & ~(PA_STREAM_START_CORKED|
@@ -1122,6 +1126,7 @@ int pa_stream_write(
pa_assert(PA_REFCNT_VALUE(s) >= 1);
pa_assert(data);
+ PA_CHECK_VALIDITY(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY(s->context, s->direction == PA_STREAM_PLAYBACK || s->direction == PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY(s->context, seek <= PA_SEEK_RELATIVE_END, PA_ERR_INVALID);
@@ -1216,6 +1221,7 @@ int pa_stream_peek(pa_stream *s, const void **data, size_t *length) {
pa_assert(data);
pa_assert(length);
+ PA_CHECK_VALIDITY(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY(s->context, s->direction == PA_STREAM_RECORD, PA_ERR_BADSTATE);
@@ -1240,6 +1246,7 @@ int pa_stream_drop(pa_stream *s) {
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY(s->context, s->direction == PA_STREAM_RECORD, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY(s->context, s->peek_memchunk.memblock, PA_ERR_BADSTATE);
@@ -1262,6 +1269,7 @@ size_t pa_stream_writable_size(pa_stream *s) {
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY_RETURN_ANY(s->context, !pa_detect_fork(), PA_ERR_FORKED, (size_t) -1);
PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE, (size_t) -1);
PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->direction != PA_STREAM_RECORD, PA_ERR_BADSTATE, (size_t) -1);
@@ -1272,6 +1280,7 @@ size_t pa_stream_readable_size(pa_stream *s) {
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY_RETURN_ANY(s->context, !pa_detect_fork(), PA_ERR_FORKED, (size_t) -1);
PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE, (size_t) -1);
PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->direction == PA_STREAM_RECORD, PA_ERR_BADSTATE, (size_t) -1);
@@ -1286,6 +1295,7 @@ pa_operation * pa_stream_drain(pa_stream *s, pa_stream_success_cb_t cb, void *us
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction == PA_STREAM_PLAYBACK, PA_ERR_BADSTATE);
@@ -1557,6 +1567,7 @@ pa_operation* pa_stream_update_timing_info(pa_stream *s, pa_stream_success_cb_t
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
@@ -1627,6 +1638,7 @@ int pa_stream_disconnect(pa_stream *s) {
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY(s->context, s->channel_valid, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY(s->context, s->context->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
@@ -1649,6 +1661,9 @@ void pa_stream_set_read_callback(pa_stream *s, pa_stream_request_cb_t cb, void *
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ if (pa_detect_fork())
+ return;
+
if (s->state == PA_STREAM_TERMINATED || s->state == PA_STREAM_FAILED)
return;
@@ -1660,6 +1675,9 @@ void pa_stream_set_write_callback(pa_stream *s, pa_stream_request_cb_t cb, void
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ if (pa_detect_fork())
+ return;
+
if (s->state == PA_STREAM_TERMINATED || s->state == PA_STREAM_FAILED)
return;
@@ -1671,6 +1689,9 @@ void pa_stream_set_state_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ if (pa_detect_fork())
+ return;
+
if (s->state == PA_STREAM_TERMINATED || s->state == PA_STREAM_FAILED)
return;
@@ -1682,6 +1703,9 @@ void pa_stream_set_overflow_callback(pa_stream *s, pa_stream_notify_cb_t cb, voi
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ if (pa_detect_fork())
+ return;
+
if (s->state == PA_STREAM_TERMINATED || s->state == PA_STREAM_FAILED)
return;
@@ -1693,6 +1717,9 @@ void pa_stream_set_underflow_callback(pa_stream *s, pa_stream_notify_cb_t cb, vo
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ if (pa_detect_fork())
+ return;
+
if (s->state == PA_STREAM_TERMINATED || s->state == PA_STREAM_FAILED)
return;
@@ -1704,6 +1731,9 @@ void pa_stream_set_latency_update_callback(pa_stream *s, pa_stream_notify_cb_t c
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ if (pa_detect_fork())
+ return;
+
if (s->state == PA_STREAM_TERMINATED || s->state == PA_STREAM_FAILED)
return;
@@ -1715,6 +1745,9 @@ void pa_stream_set_moved_callback(pa_stream *s, pa_stream_notify_cb_t cb, void *
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ if (pa_detect_fork())
+ return;
+
if (s->state == PA_STREAM_TERMINATED || s->state == PA_STREAM_FAILED)
return;
@@ -1726,6 +1759,9 @@ void pa_stream_set_suspended_callback(pa_stream *s, pa_stream_notify_cb_t cb, vo
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ if (pa_detect_fork())
+ return;
+
if (s->state == PA_STREAM_TERMINATED || s->state == PA_STREAM_FAILED)
return;
@@ -1737,6 +1773,9 @@ void pa_stream_set_started_callback(pa_stream *s, pa_stream_notify_cb_t cb, void
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ if (pa_detect_fork())
+ return;
+
if (s->state == PA_STREAM_TERMINATED || s->state == PA_STREAM_FAILED)
return;
@@ -1748,6 +1787,9 @@ void pa_stream_set_event_callback(pa_stream *s, pa_stream_event_cb_t cb, void *u
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ if (pa_detect_fork())
+ return;
+
if (s->state == PA_STREAM_TERMINATED || s->state == PA_STREAM_FAILED)
return;
@@ -1794,6 +1836,7 @@ pa_operation* pa_stream_cork(pa_stream *s, int b, pa_stream_success_cb_t cb, voi
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
@@ -1827,6 +1870,7 @@ static pa_operation* stream_send_simple_command(pa_stream *s, uint32_t command,
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
o = pa_operation_new(s->context, s, (pa_operation_cb_t) cb, userdata);
@@ -1845,6 +1889,7 @@ pa_operation* pa_stream_flush(pa_stream *s, pa_stream_success_cb_t cb, void *use
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
@@ -1877,6 +1922,7 @@ pa_operation* pa_stream_prebuf(pa_stream *s, pa_stream_success_cb_t cb, void *us
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction == PA_STREAM_PLAYBACK, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->buffer_attr.prebuf > 0, PA_ERR_BADSTATE);
@@ -1897,6 +1943,7 @@ pa_operation* pa_stream_trigger(pa_stream *s, pa_stream_success_cb_t cb, void *u
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction == PA_STREAM_PLAYBACK, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->buffer_attr.prebuf > 0, PA_ERR_BADSTATE);
@@ -1918,6 +1965,7 @@ pa_operation* pa_stream_set_name(pa_stream *s, const char *name, pa_stream_succe
pa_assert(PA_REFCNT_VALUE(s) >= 1);
pa_assert(name);
+ PA_CHECK_VALIDITY_RETURN_NULL(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
@@ -1951,6 +1999,7 @@ int pa_stream_get_time(pa_stream *s, pa_usec_t *r_usec) {
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY(s->context, s->timing_info_valid, PA_ERR_NODATA);
@@ -2003,6 +2052,7 @@ int pa_stream_get_latency(pa_stream *s, pa_usec_t *r_usec, int *negative) {
pa_assert(PA_REFCNT_VALUE(s) >= 1);
pa_assert(r_usec);
+ PA_CHECK_VALIDITY(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY(s->context, s->timing_info_valid, PA_ERR_NODATA);
@@ -2034,6 +2084,7 @@ const pa_timing_info* pa_stream_get_timing_info(pa_stream *s) {
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->timing_info_valid, PA_ERR_NODATA);
@@ -2045,6 +2096,8 @@ const pa_sample_spec* pa_stream_get_sample_spec(pa_stream *s) {
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(s->context, !pa_detect_fork(), PA_ERR_FORKED);
+
return &s->sample_spec;
}
@@ -2052,6 +2105,8 @@ const pa_channel_map* pa_stream_get_channel_map(pa_stream *s) {
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(s->context, !pa_detect_fork(), PA_ERR_FORKED);
+
return &s->channel_map;
}
@@ -2139,6 +2194,7 @@ pa_operation* pa_stream_set_buffer_attr(pa_stream *s, const pa_buffer_attr *attr
pa_assert(PA_REFCNT_VALUE(s) >= 1);
pa_assert(attr);
+ PA_CHECK_VALIDITY_RETURN_NULL(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->context->version >= 12, PA_ERR_NOTSUPPORTED);
@@ -2183,6 +2239,7 @@ uint32_t pa_stream_get_device_index(pa_stream *s) {
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY_RETURN_ANY(s->context, !pa_detect_fork(), PA_ERR_FORKED, PA_INVALID_INDEX);
PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE, PA_INVALID_INDEX);
PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE, PA_INVALID_INDEX);
PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->context->version >= 12, PA_ERR_NOTSUPPORTED, PA_INVALID_INDEX);
@@ -2195,6 +2252,7 @@ const char *pa_stream_get_device_name(pa_stream *s) {
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->context->version >= 12, PA_ERR_NOTSUPPORTED);
@@ -2207,6 +2265,7 @@ int pa_stream_is_suspended(pa_stream *s) {
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY(s->context, s->context->version >= 12, PA_ERR_NOTSUPPORTED);
@@ -2218,6 +2277,7 @@ int pa_stream_is_corked(pa_stream *s) {
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
@@ -2270,6 +2330,7 @@ pa_operation *pa_stream_update_sample_rate(pa_stream *s, uint32_t rate, pa_strea
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, rate > 0 && rate <= PA_RATE_MAX, PA_ERR_INVALID);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
@@ -2300,6 +2361,7 @@ pa_operation *pa_stream_proplist_update(pa_stream *s, pa_update_mode_t mode, pa_
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, mode == PA_UPDATE_SET || mode == PA_UPDATE_MERGE || mode == PA_UPDATE_REPLACE, PA_ERR_INVALID);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
@@ -2333,6 +2395,7 @@ pa_operation *pa_stream_proplist_remove(pa_stream *s, const char *const keys[],
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY_RETURN_NULL(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, keys && keys[0], PA_ERR_INVALID);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
@@ -2364,6 +2427,7 @@ int pa_stream_set_monitor_stream(pa_stream *s, uint32_t sink_input_idx) {
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY(s->context, sink_input_idx != PA_INVALID_INDEX, PA_ERR_INVALID);
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_UNCONNECTED, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY(s->context, s->context->version >= 13, PA_ERR_NOTSUPPORTED);
@@ -2377,6 +2441,7 @@ uint32_t pa_stream_get_monitor_stream(pa_stream *s) {
pa_assert(s);
pa_assert(PA_REFCNT_VALUE(s) >= 1);
+ PA_CHECK_VALIDITY_RETURN_ANY(s->context, !pa_detect_fork(), PA_ERR_FORKED, PA_INVALID_INDEX);
PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->direct_on_input != PA_INVALID_INDEX, PA_ERR_BADSTATE, PA_INVALID_INDEX);
PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->context->version >= 13, PA_ERR_NOTSUPPORTED, PA_INVALID_INDEX);
diff --git a/src/pulse/stream.h b/src/pulse/stream.h
index 3965e9a2..e80bc65d 100644
--- a/src/pulse/stream.h
+++ b/src/pulse/stream.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/pulse/subscribe.c b/src/pulse/subscribe.c
index e12d1446..203bc928 100644
--- a/src/pulse/subscribe.c
+++ b/src/pulse/subscribe.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/pulse/subscribe.h b/src/pulse/subscribe.h
index 2707cec5..a93510ad 100644
--- a/src/pulse/subscribe.h
+++ b/src/pulse/subscribe.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/pulse/thread-mainloop.c b/src/pulse/thread-mainloop.c
index fb73ff1b..c77cc64e 100644
--- a/src/pulse/thread-mainloop.c
+++ b/src/pulse/thread-mainloop.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/pulse/thread-mainloop.h b/src/pulse/thread-mainloop.h
index 4de338a1..8eddce4c 100644
--- a/src/pulse/thread-mainloop.h
+++ b/src/pulse/thread-mainloop.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
@@ -108,10 +108,10 @@ PA_C_DECL_BEGIN
* Example:
*
* \code
- * static void my_drain_callback(pa_stream*s, int success, void *userdata) {
+ * static void my_drain_callback(pa_stream *s, int success, void *userdata) {
* pa_threaded_mainloop *m;
*
- * m = (pa_threaded_mainloop*)userdata;
+ * m = userdata;
* assert(m);
*
* pa_threaded_mainloop_signal(m, 0);
@@ -125,7 +125,7 @@ PA_C_DECL_BEGIN
* o = pa_stream_drain(s, my_drain_callback, m);
* assert(o);
*
- * while (pa_operation_get_state(o) != OPERATION_DONE)
+ * while (pa_operation_get_state(o) == PA_OPERATION_RUNNING)
* pa_threaded_mainloop_wait(m);
*
* pa_operation_unref(o);
@@ -167,7 +167,7 @@ PA_C_DECL_BEGIN
* static void my_drain_callback(pa_stream*s, int success, void *userdata) {
* pa_threaded_mainloop *m;
*
- * m = (pa_threaded_mainloop*)userdata;
+ * m = userdata;
* assert(m);
*
* drain_result = &success;
@@ -183,7 +183,7 @@ PA_C_DECL_BEGIN
* o = pa_stream_drain(s, my_drain_callback, m);
* assert(o);
*
- * while (pa_operation_get_state(o) != OPERATION_DONE)
+ * while (pa_operation_get_state(o) == PA_OPERATION_RUNNING)
* pa_threaded_mainloop_wait(m);
*
* pa_operation_unref(o);
diff --git a/src/pulse/volume.c b/src/pulse/volume.c
index 54838e89..c865058d 100644
--- a/src/pulse/volume.c
+++ b/src/pulse/volume.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/pulse/volume.h b/src/pulse/volume.h
index 8bfd0687..c3c396c8 100644
--- a/src/pulse/volume.h
+++ b/src/pulse/volume.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/pulse/xmalloc.c b/src/pulse/xmalloc.c
index c570e40f..e17a354a 100644
--- a/src/pulse/xmalloc.c
+++ b/src/pulse/xmalloc.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/pulse/xmalloc.h b/src/pulse/xmalloc.h
index c30d4df1..db20496f 100644
--- a/src/pulse/xmalloc.h
+++ b/src/pulse/xmalloc.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/pulsecore/atomic.h b/src/pulsecore/atomic.h
index 6e33a0e6..119c445b 100644
--- a/src/pulsecore/atomic.h
+++ b/src/pulsecore/atomic.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
+ 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/pulsecore/auth-cookie.c b/src/pulsecore/auth-cookie.c
index 68b01473..2f45eca0 100644
--- a/src/pulsecore/auth-cookie.c
+++ b/src/pulsecore/auth-cookie.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/pulsecore/auth-cookie.h b/src/pulsecore/auth-cookie.h
index c08cbd82..3db40bcd 100644
--- a/src/pulsecore/auth-cookie.h
+++ b/src/pulsecore/auth-cookie.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/pulsecore/avahi-wrap.c b/src/pulsecore/avahi-wrap.c
index d5f40d83..56d9d3dd 100644
--- a/src/pulsecore/avahi-wrap.c
+++ b/src/pulsecore/avahi-wrap.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/pulsecore/avahi-wrap.h b/src/pulsecore/avahi-wrap.h
index 7d8995bb..5a0c2ef8 100644
--- a/src/pulsecore/avahi-wrap.h
+++ b/src/pulsecore/avahi-wrap.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/pulsecore/bitset.c b/src/pulsecore/bitset.c
index 4beeb1cc..4b62fc4f 100644
--- a/src/pulsecore/bitset.c
+++ b/src/pulsecore/bitset.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/pulsecore/bitset.h b/src/pulsecore/bitset.h
index 95f5cfce..a86a15e7 100644
--- a/src/pulsecore/bitset.h
+++ b/src/pulsecore/bitset.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/pulsecore/card.c b/src/pulsecore/card.c
index 515d1f90..6419c234 100644
--- a/src/pulsecore/card.c
+++ b/src/pulsecore/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
@@ -160,6 +160,9 @@ pa_card *pa_card_new(pa_core *core, pa_card_new_data *data) {
c->userdata = NULL;
c->set_profile = NULL;
+ pa_device_init_description(c->proplist);
+ pa_device_init_icon(c->proplist, TRUE);
+
pa_assert_se(pa_idxset_put(core->cards, c, &c->index) >= 0);
pa_log_info("Created %u \"%s\"", c->index, c->name);
diff --git a/src/pulsecore/card.h b/src/pulsecore/card.h
index b179831e..c80d4e2e 100644
--- a/src/pulsecore/card.h
+++ b/src/pulsecore/card.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/pulsecore/cli-command.c b/src/pulsecore/cli-command.c
index 4ce87d6d..b5f7e7f5 100644
--- a/src/pulsecore/cli-command.c
+++ b/src/pulsecore/cli-command.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
@@ -32,6 +32,7 @@
#include <ltdl.h>
#include <pulse/xmalloc.h>
+#include <pulse/error.h>
#include <pulsecore/module.h>
#include <pulsecore/sink.h>
@@ -1236,7 +1237,7 @@ static int pa_cli_command_move_source_output(pa_core *c, pa_tokenizer *t, pa_str
static int pa_cli_command_suspend_sink(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
const char *n, *m;
pa_sink *sink;
- int suspend;
+ int suspend, r;
pa_core_assert_ref(c);
pa_assert(t);
@@ -1263,14 +1264,16 @@ static int pa_cli_command_suspend_sink(pa_core *c, pa_tokenizer *t, pa_strbuf *b
return -1;
}
- pa_sink_suspend(sink, suspend);
+ if ((r = pa_sink_suspend(sink, suspend)) < 0)
+ pa_strbuf_printf(buf, "Failed to resume/suspend sink: %s\n", pa_strerror(r));
+
return 0;
}
static int pa_cli_command_suspend_source(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
const char *n, *m;
pa_source *source;
- int suspend;
+ int suspend, r;
pa_core_assert_ref(c);
pa_assert(t);
@@ -1297,14 +1300,15 @@ static int pa_cli_command_suspend_source(pa_core *c, pa_tokenizer *t, pa_strbuf
return -1;
}
- pa_source_suspend(source, suspend);
+ if ((r = pa_source_suspend(source, suspend)) < 0)
+ pa_strbuf_printf(buf, "Failed to resume/suspend source: %s\n", pa_strerror(r));
+
return 0;
}
static int pa_cli_command_suspend(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, pa_bool_t *fail) {
const char *m;
- int suspend;
- int ret;
+ int suspend, r;
pa_core_assert_ref(c);
pa_assert(t);
@@ -1321,12 +1325,11 @@ static int pa_cli_command_suspend(pa_core *c, pa_tokenizer *t, pa_strbuf *buf, p
return -1;
}
- ret = - (pa_sink_suspend_all(c, suspend) < 0);
- if (pa_source_suspend_all(c, suspend) < 0)
- ret = -1;
+ if ((r = pa_sink_suspend_all(c, suspend)) < 0)
+ pa_strbuf_printf(buf, "Failed to resume/suspend all sinks: %s\n", pa_strerror(r));
- if (ret < 0)
- pa_strbuf_puts(buf, "Failed to resume/suspend all sinks/sources.\n");
+ if ((r = pa_source_suspend_all(c, suspend)) < 0)
+ pa_strbuf_printf(buf, "Failed to resume/suspend all sources: %s\n", pa_strerror(r));
return 0;
}
diff --git a/src/pulsecore/cli-command.h b/src/pulsecore/cli-command.h
index 9bf35dc3..8c33ec08 100644
--- a/src/pulsecore/cli-command.h
+++ b/src/pulsecore/cli-command.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/pulsecore/cli-text.c b/src/pulsecore/cli-text.c
index 8ca8f2d9..76adc4dd 100644
--- a/src/pulsecore/cli-text.c
+++ b/src/pulsecore/cli-text.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/pulsecore/cli-text.h b/src/pulsecore/cli-text.h
index aad51648..a5dd10e2 100644
--- a/src/pulsecore/cli-text.h
+++ b/src/pulsecore/cli-text.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/pulsecore/cli.c b/src/pulsecore/cli.c
index 25a4f748..a784f583 100644
--- a/src/pulsecore/cli.c
+++ b/src/pulsecore/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/pulsecore/cli.h b/src/pulsecore/cli.h
index d8604611..ebab6c21 100644
--- a/src/pulsecore/cli.h
+++ b/src/pulsecore/cli.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/pulsecore/client.c b/src/pulsecore/client.c
index e6e8b528..c956b101 100644
--- a/src/pulsecore/client.c
+++ b/src/pulsecore/client.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/pulsecore/client.h b/src/pulsecore/client.h
index 845a8bab..18b62dac 100644
--- a/src/pulsecore/client.h
+++ b/src/pulsecore/client.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/pulsecore/conf-parser.c b/src/pulsecore/conf-parser.c
index 1d98f36c..a6eb581c 100644
--- a/src/pulsecore/conf-parser.c
+++ b/src/pulsecore/conf-parser.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/pulsecore/conf-parser.h b/src/pulsecore/conf-parser.h
index f8f059fe..08e17ca7 100644
--- a/src/pulsecore/conf-parser.h
+++ b/src/pulsecore/conf-parser.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/pulsecore/core-error.c b/src/pulsecore/core-error.c
index d9caa946..c4408069 100644
--- a/src/pulsecore/core-error.c
+++ b/src/pulsecore/core-error.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/pulsecore/core-error.h b/src/pulsecore/core-error.h
index b0c306c7..e7bc4fca 100644
--- a/src/pulsecore/core-error.h
+++ b/src/pulsecore/core-error.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/pulsecore/core-scache.c b/src/pulsecore/core-scache.c
index e5489415..34d60a8f 100644
--- a/src/pulsecore/core-scache.c
+++ b/src/pulsecore/core-scache.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/pulsecore/core-scache.h b/src/pulsecore/core-scache.h
index 1fe3c309..fdfc7754 100644
--- a/src/pulsecore/core-scache.h
+++ b/src/pulsecore/core-scache.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/pulsecore/core-subscribe.c b/src/pulsecore/core-subscribe.c
index c70d8adc..54fb7ec2 100644
--- a/src/pulsecore/core-subscribe.c
+++ b/src/pulsecore/core-subscribe.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/pulsecore/core-subscribe.h b/src/pulsecore/core-subscribe.h
index 2f9730d9..dd748d36 100644
--- a/src/pulsecore/core-subscribe.h
+++ b/src/pulsecore/core-subscribe.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/pulsecore/core-util.c b/src/pulsecore/core-util.c
index a184bebd..0d243ee6 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -2505,7 +2505,7 @@ char *pa_machine_id(void) {
char *pa_uname_string(void) {
struct utsname u;
- pa_assert_se(uname(&u) == 0);
+ pa_assert_se(uname(&u) >= 0);
return pa_sprintf_malloc("%s %s %s %s", u.sysname, u.machine, u.release, u.version);
}
diff --git a/src/pulsecore/core.c b/src/pulsecore/core.c
index eef967a6..06573f17 100644
--- a/src/pulsecore/core.c
+++ b/src/pulsecore/core.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
@@ -250,3 +250,14 @@ int pa_core_exit(pa_core *c, pa_bool_t force, int retval) {
c->mainloop->quit(c->mainloop, retval);
return 0;
}
+
+void pa_core_maybe_vacuum(pa_core *c) {
+ pa_assert(c);
+
+ if (!pa_idxset_isempty(c->sink_inputs) ||
+ !pa_idxset_isempty(c->source_outputs))
+ return;
+
+ pa_log_debug("Hmm, no streams around, trying to vacuum.");
+ pa_mempool_vacuum(c->mempool);
+}
diff --git a/src/pulsecore/core.h b/src/pulsecore/core.h
index 7660bd3b..c6794445 100644
--- a/src/pulsecore/core.h
+++ b/src/pulsecore/core.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
@@ -171,4 +171,6 @@ void pa_core_check_idle(pa_core *c);
int pa_core_exit(pa_core *c, pa_bool_t force, int retval);
+void pa_core_maybe_vacuum(pa_core *c);
+
#endif
diff --git a/src/pulsecore/dllmain.c b/src/pulsecore/dllmain.c
index 269de604..491ec75f 100644
--- a/src/pulsecore/dllmain.c
+++ b/src/pulsecore/dllmain.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/pulsecore/endianmacros.h b/src/pulsecore/endianmacros.h
index eea1c743..22579376 100644
--- a/src/pulsecore/endianmacros.h
+++ b/src/pulsecore/endianmacros.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/pulsecore/esound.h b/src/pulsecore/esound.h
index 79322ae4..abc2355f 100644
--- a/src/pulsecore/esound.h
+++ b/src/pulsecore/esound.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/pulsecore/ffmpeg/resample2.c b/src/pulsecore/ffmpeg/resample2.c
index ed59448a..ac9db73c 100644
--- a/src/pulsecore/ffmpeg/resample2.c
+++ b/src/pulsecore/ffmpeg/resample2.c
@@ -20,7 +20,7 @@
*/
/**
- * @file resample2.c
+ * @file libavcodec/resample2.c
* audio resampling
* @author Michael Niedermayer <michaelni@gmx.at>
*/
@@ -175,10 +175,6 @@ void av_build_filter(FELEM *filter, double factor, int tap_count, int phase_coun
#endif
}
-/**
- * Initializes an audio resampler.
- * Note, if either rate is not an integer then simply scale both rates up so they are.
- */
AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_size, int phase_shift, int linear, double cutoff){
AVResampleContext *c= av_mallocz(sizeof(AVResampleContext));
double factor= FFMIN(out_rate * cutoff / in_rate, 1.0);
@@ -206,33 +202,12 @@ void av_resample_close(AVResampleContext *c){
av_freep(&c);
}
-/**
- * Compensates samplerate/timestamp drift. The compensation is done by changing
- * the resampler parameters, so no audible clicks or similar distortions occur
- * @param compensation_distance distance in output samples over which the compensation should be performed
- * @param sample_delta number of output samples which should be output less
- *
- * example: av_resample_compensate(c, 10, 500)
- * here instead of 510 samples only 500 samples would be output
- *
- * note, due to rounding the actual compensation might be slightly different,
- * especially if the compensation_distance is large and the in_rate used during init is small
- */
void av_resample_compensate(AVResampleContext *c, int sample_delta, int compensation_distance){
// sample_delta += (c->ideal_dst_incr - c->dst_incr)*(int64_t)c->compensation_distance / c->ideal_dst_incr;
c->compensation_distance= compensation_distance;
c->dst_incr = c->ideal_dst_incr - c->ideal_dst_incr * (int64_t)sample_delta / compensation_distance;
}
-/**
- * resamples.
- * @param src an array of unconsumed samples
- * @param consumed the number of samples of src which have been consumed are returned here
- * @param src_size the number of unconsumed samples available
- * @param dst_size the amount of space in samples available in dst
- * @param update_ctx if this is 0 then the context wont be modified, that way several channels can be resampled with the same context
- * @return the number of samples written in dst or -1 if an error occurred
- */
int av_resample(AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx){
int dst_index, i;
int index= c->index;
diff --git a/src/pulsecore/flist.h b/src/pulsecore/flist.h
index 512dd357..e147486e 100644
--- a/src/pulsecore/flist.h
+++ b/src/pulsecore/flist.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/pulsecore/hashmap.c b/src/pulsecore/hashmap.c
index 57607b69..e957c5ba 100644
--- a/src/pulsecore/hashmap.c
+++ b/src/pulsecore/hashmap.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/pulsecore/hashmap.h b/src/pulsecore/hashmap.h
index 70d78b75..08e18ead 100644
--- a/src/pulsecore/hashmap.h
+++ b/src/pulsecore/hashmap.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/pulsecore/hook-list.c b/src/pulsecore/hook-list.c
index 39694038..5f7a8665 100644
--- a/src/pulsecore/hook-list.c
+++ b/src/pulsecore/hook-list.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/pulsecore/hook-list.h b/src/pulsecore/hook-list.h
index de947ad5..8514cced 100644
--- a/src/pulsecore/hook-list.h
+++ b/src/pulsecore/hook-list.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/pulsecore/ioline.c b/src/pulsecore/ioline.c
index 88174c05..5c38d6e5 100644
--- a/src/pulsecore/ioline.c
+++ b/src/pulsecore/ioline.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/pulsecore/ioline.h b/src/pulsecore/ioline.h
index b9a3d9f4..9f32d60f 100644
--- a/src/pulsecore/ioline.h
+++ b/src/pulsecore/ioline.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/pulsecore/llist.h b/src/pulsecore/llist.h
index 46b54eb3..77a1749f 100644
--- a/src/pulsecore/llist.h
+++ b/src/pulsecore/llist.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/pulsecore/lock-autospawn.c b/src/pulsecore/lock-autospawn.c
index d36b669e..4436974d 100644
--- a/src/pulsecore/lock-autospawn.c
+++ b/src/pulsecore/lock-autospawn.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/pulsecore/log.c b/src/pulsecore/log.c
index 9931586d..d4d3b76e 100644
--- a/src/pulsecore/log.c
+++ b/src/pulsecore/log.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
diff --git a/src/pulsecore/log.h b/src/pulsecore/log.h
index 6e7bfc35..153e11e8 100644
--- a/src/pulsecore/log.h
+++ b/src/pulsecore/log.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/pulsecore/ltdl-helper.c b/src/pulsecore/ltdl-helper.c
index ed0b63af..be200ca2 100644
--- a/src/pulsecore/ltdl-helper.c
+++ b/src/pulsecore/ltdl-helper.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/pulsecore/ltdl-helper.h b/src/pulsecore/ltdl-helper.h
index ea73de54..4c4f018a 100644
--- a/src/pulsecore/ltdl-helper.h
+++ b/src/pulsecore/ltdl-helper.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/pulsecore/macro.h b/src/pulsecore/macro.h
index 59460012..20015bf5 100644
--- a/src/pulsecore/macro.h
+++ b/src/pulsecore/macro.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/pulsecore/memblockq.c b/src/pulsecore/memblockq.c
index 265da37f..e2be42b3 100644
--- a/src/pulsecore/memblockq.c
+++ b/src/pulsecore/memblockq.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/pulsecore/memblockq.h b/src/pulsecore/memblockq.h
index 31f908df..0a74aa37 100644
--- a/src/pulsecore/memblockq.h
+++ b/src/pulsecore/memblockq.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/pulsecore/modargs.c b/src/pulsecore/modargs.c
index 4a30f52a..73c67a8b 100644
--- a/src/pulsecore/modargs.c
+++ b/src/pulsecore/modargs.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/pulsecore/modargs.h b/src/pulsecore/modargs.h
index 23766cfc..809fb27e 100644
--- a/src/pulsecore/modargs.h
+++ b/src/pulsecore/modargs.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/pulsecore/modinfo.c b/src/pulsecore/modinfo.c
index ac4ca88a..00fb9c43 100644
--- a/src/pulsecore/modinfo.c
+++ b/src/pulsecore/modinfo.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/pulsecore/modinfo.h b/src/pulsecore/modinfo.h
index 605637c4..407e602a 100644
--- a/src/pulsecore/modinfo.h
+++ b/src/pulsecore/modinfo.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/pulsecore/module.c b/src/pulsecore/module.c
index 1eb70c8e..42fd912c 100644
--- a/src/pulsecore/module.c
+++ b/src/pulsecore/module.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/pulsecore/module.h b/src/pulsecore/module.h
index 6ab43dcf..3f697348 100644
--- a/src/pulsecore/module.h
+++ b/src/pulsecore/module.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/pulsecore/msgobject.c b/src/pulsecore/msgobject.c
index 81417ea4..6a2a612d 100644
--- a/src/pulsecore/msgobject.c
+++ b/src/pulsecore/msgobject.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/pulsecore/msgobject.h b/src/pulsecore/msgobject.h
index 1a43fa35..a35a23b5 100644
--- a/src/pulsecore/msgobject.h
+++ b/src/pulsecore/msgobject.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/pulsecore/mutex-posix.c b/src/pulsecore/mutex-posix.c
index c3ead97d..b3e5256a 100644
--- a/src/pulsecore/mutex-posix.c
+++ b/src/pulsecore/mutex-posix.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/pulsecore/mutex-win32.c b/src/pulsecore/mutex-win32.c
index 5e884e7f..3a910b03 100644
--- a/src/pulsecore/mutex-win32.c
+++ b/src/pulsecore/mutex-win32.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/pulsecore/mutex.h b/src/pulsecore/mutex.h
index 8e0b1f2e..a4dd6738 100644
--- a/src/pulsecore/mutex.h
+++ b/src/pulsecore/mutex.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/pulsecore/namereg.c b/src/pulsecore/namereg.c
index 5ab3036e..9df2f583 100644
--- a/src/pulsecore/namereg.c
+++ b/src/pulsecore/namereg.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/pulsecore/namereg.h b/src/pulsecore/namereg.h
index ff99525e..38fae6f5 100644
--- a/src/pulsecore/namereg.h
+++ b/src/pulsecore/namereg.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/pulsecore/object.c b/src/pulsecore/object.c
index 9a2f28f3..8fd05fb6 100644
--- a/src/pulsecore/object.c
+++ b/src/pulsecore/object.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/pulsecore/object.h b/src/pulsecore/object.h
index 2ee4fc31..43e79327 100644
--- a/src/pulsecore/object.h
+++ b/src/pulsecore/object.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/pulsecore/once.c b/src/pulsecore/once.c
index 3d4543cb..05a3ad2c 100644
--- a/src/pulsecore/once.c
+++ b/src/pulsecore/once.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/pulsecore/once.h b/src/pulsecore/once.h
index c0191ef0..50ac18c1 100644
--- a/src/pulsecore/once.h
+++ b/src/pulsecore/once.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/pulsecore/pid.c b/src/pulsecore/pid.c
index bf9ba983..00878462 100644
--- a/src/pulsecore/pid.c
+++ b/src/pulsecore/pid.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
diff --git a/src/pulsecore/pid.h b/src/pulsecore/pid.h
index 3c8a9de3..d8458bf7 100644
--- a/src/pulsecore/pid.h
+++ b/src/pulsecore/pid.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/pulsecore/pipe.c b/src/pulsecore/pipe.c
index 93d78a22..c21e4b1f 100644
--- a/src/pulsecore/pipe.c
+++ b/src/pulsecore/pipe.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/pulsecore/pipe.h b/src/pulsecore/pipe.h
index 9a7e62c8..597d5e52 100644
--- a/src/pulsecore/pipe.h
+++ b/src/pulsecore/pipe.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/pulsecore/play-memblockq.c b/src/pulsecore/play-memblockq.c
index 44aa6bf0..fceb2ca1 100644
--- a/src/pulsecore/play-memblockq.c
+++ b/src/pulsecore/play-memblockq.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/pulsecore/play-memblockq.h b/src/pulsecore/play-memblockq.h
index 1a42867b..9d5f40fd 100644
--- a/src/pulsecore/play-memblockq.h
+++ b/src/pulsecore/play-memblockq.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/pulsecore/play-memchunk.c b/src/pulsecore/play-memchunk.c
index 0dd48251..f127d7a4 100644
--- a/src/pulsecore/play-memchunk.c
+++ b/src/pulsecore/play-memchunk.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/pulsecore/play-memchunk.h b/src/pulsecore/play-memchunk.h
index c312ae82..c813611e 100644
--- a/src/pulsecore/play-memchunk.h
+++ b/src/pulsecore/play-memchunk.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/pulsecore/poll.c b/src/pulsecore/poll.c
index 88ac21e4..46a69c5f 100644
--- a/src/pulsecore/poll.c
+++ b/src/pulsecore/poll.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/pulsecore/poll.h b/src/pulsecore/poll.h
index 86c37a08..fe0c6af6 100644
--- a/src/pulsecore/poll.h
+++ b/src/pulsecore/poll.h
@@ -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/pulsecore/prioq.c b/src/pulsecore/prioq.c
index 693dc517..983db0f1 100644
--- a/src/pulsecore/prioq.c
+++ b/src/pulsecore/prioq.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/pulsecore/protocol-cli.c b/src/pulsecore/protocol-cli.c
index 9247bb40..da648744 100644
--- a/src/pulsecore/protocol-cli.c
+++ b/src/pulsecore/protocol-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/pulsecore/protocol-cli.h b/src/pulsecore/protocol-cli.h
index 9e26dcd9..906b13f3 100644
--- a/src/pulsecore/protocol-cli.h
+++ b/src/pulsecore/protocol-cli.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/pulsecore/protocol-esound.c b/src/pulsecore/protocol-esound.c
index 2d4e62fa..2b80c65f 100644
--- a/src/pulsecore/protocol-esound.c
+++ b/src/pulsecore/protocol-esound.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
@@ -1290,6 +1290,9 @@ static int connection_process_msg(pa_msgobject *o, int code, void*userdata, int6
connection *c = CONNECTION(o);
connection_assert_ref(c);
+ if (!c->protocol)
+ return -1;
+
switch (code) {
case CONNECTION_MESSAGE_REQUEST_DATA:
do_work(c);
diff --git a/src/pulsecore/protocol-esound.h b/src/pulsecore/protocol-esound.h
index 232df660..63a29ce8 100644
--- a/src/pulsecore/protocol-esound.h
+++ b/src/pulsecore/protocol-esound.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/pulsecore/protocol-http.c b/src/pulsecore/protocol-http.c
index 5379a36c..f3b93819 100644
--- a/src/pulsecore/protocol-http.c
+++ b/src/pulsecore/protocol-http.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/pulsecore/protocol-http.h b/src/pulsecore/protocol-http.h
index 7e8f9760..40b3d82c 100644
--- a/src/pulsecore/protocol-http.h
+++ b/src/pulsecore/protocol-http.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/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 10b9e7da..50a9191b 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.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
@@ -2829,6 +2829,7 @@ static void card_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_car
pa_tagstruct_puts(t, p->description);
pa_tagstruct_putu32(t, p->n_sinks);
pa_tagstruct_putu32(t, p->n_sources);
+ pa_tagstruct_putu32(t, p->priority);
}
}
@@ -2955,7 +2956,6 @@ static void command_get_info(pa_pdispatch *pd, uint32_t command, uint32_t tag, p
if (pa_tagstruct_getu32(t, &idx) < 0 ||
(command != PA_COMMAND_GET_CLIENT_INFO &&
- command != PA_COMMAND_GET_CARD_INFO &&
command != PA_COMMAND_GET_MODULE_INFO &&
command != PA_COMMAND_GET_SINK_INPUT_INFO &&
command != PA_COMMAND_GET_SOURCE_OUTPUT_INFO &&
diff --git a/src/pulsecore/protocol-native.h b/src/pulsecore/protocol-native.h
index 06731c0c..8a8d601c 100644
--- a/src/pulsecore/protocol-native.h
+++ b/src/pulsecore/protocol-native.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/pulsecore/protocol-simple.c b/src/pulsecore/protocol-simple.c
index e149c40d..44fe5973 100644
--- a/src/pulsecore/protocol-simple.c
+++ b/src/pulsecore/protocol-simple.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
@@ -283,6 +283,9 @@ static int connection_process_msg(pa_msgobject *o, int code, void*userdata, int6
connection *c = CONNECTION(o);
connection_assert_ref(c);
+ if (!c->protocol)
+ return -1;
+
switch (code) {
case CONNECTION_MESSAGE_REQUEST_DATA:
do_work(c);
diff --git a/src/pulsecore/protocol-simple.h b/src/pulsecore/protocol-simple.h
index c10eabe7..a25ab80a 100644
--- a/src/pulsecore/protocol-simple.h
+++ b/src/pulsecore/protocol-simple.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/pulsecore/ratelimit.c b/src/pulsecore/ratelimit.c
index 8ce78579..29e6fb10 100644
--- a/src/pulsecore/ratelimit.c
+++ b/src/pulsecore/ratelimit.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/pulsecore/ratelimit.h b/src/pulsecore/ratelimit.h
index e652c520..ec3b5a38 100644
--- a/src/pulsecore/ratelimit.h
+++ b/src/pulsecore/ratelimit.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/pulsecore/refcnt.h b/src/pulsecore/refcnt.h
index 291f4504..1e988326 100644
--- a/src/pulsecore/refcnt.h
+++ b/src/pulsecore/refcnt.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/pulsecore/resampler.c b/src/pulsecore/resampler.c
index 78ad5530..17fb8480 100644
--- a/src/pulsecore/resampler.c
+++ b/src/pulsecore/resampler.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/pulsecore/resampler.h b/src/pulsecore/resampler.h
index 54dfa559..742de6af 100644
--- a/src/pulsecore/resampler.h
+++ b/src/pulsecore/resampler.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/pulsecore/rtclock.c b/src/pulsecore/rtclock.c
index dcbd1184..56ab2ef0 100644
--- a/src/pulsecore/rtclock.c
+++ b/src/pulsecore/rtclock.c
@@ -27,9 +27,12 @@
#include <stddef.h>
#include <time.h>
#include <sys/time.h>
-#include <sys/prctl.h>
#include <errno.h>
+#ifdef HAVE_SYS_PRCTL_H
+#include <sys/prctl.h>
+#endif
+
#include <pulse/timeval.h>
#include <pulsecore/macro.h>
#include <pulsecore/core-error.h>
diff --git a/src/pulsecore/sample-util.c b/src/pulsecore/sample-util.c
index 905ba5df..3a9b384d 100644
--- a/src/pulsecore/sample-util.c
+++ b/src/pulsecore/sample-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/pulsecore/sample-util.h b/src/pulsecore/sample-util.h
index 2230aaf0..79af9efc 100644
--- a/src/pulsecore/sample-util.h
+++ b/src/pulsecore/sample-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/pulsecore/sconv-s16be.c b/src/pulsecore/sconv-s16be.c
index 0d5146aa..bf4f717d 100644
--- a/src/pulsecore/sconv-s16be.c
+++ b/src/pulsecore/sconv-s16be.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/pulsecore/sconv-s16be.h b/src/pulsecore/sconv-s16be.h
index 02633333..ae9e2313 100644
--- a/src/pulsecore/sconv-s16be.h
+++ b/src/pulsecore/sconv-s16be.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/pulsecore/sconv-s16le.c b/src/pulsecore/sconv-s16le.c
index 79f0391c..307ce7b7 100644
--- a/src/pulsecore/sconv-s16le.c
+++ b/src/pulsecore/sconv-s16le.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/pulsecore/sconv-s16le.h b/src/pulsecore/sconv-s16le.h
index f7b00645..609fa04b 100644
--- a/src/pulsecore/sconv-s16le.h
+++ b/src/pulsecore/sconv-s16le.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/pulsecore/sconv.c b/src/pulsecore/sconv.c
index fcd0309c..29a9a453 100644
--- a/src/pulsecore/sconv.c
+++ b/src/pulsecore/sconv.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/pulsecore/sconv.h b/src/pulsecore/sconv.h
index 59710369..b00a16a4 100644
--- a/src/pulsecore/sconv.h
+++ b/src/pulsecore/sconv.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/pulsecore/semaphore-posix.c b/src/pulsecore/semaphore-posix.c
index 7c9f859d..616d897d 100644
--- a/src/pulsecore/semaphore-posix.c
+++ b/src/pulsecore/semaphore-posix.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/pulsecore/semaphore-win32.c b/src/pulsecore/semaphore-win32.c
index 41e0b8d4..9ffbde66 100644
--- a/src/pulsecore/semaphore-win32.c
+++ b/src/pulsecore/semaphore-win32.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/pulsecore/semaphore.h b/src/pulsecore/semaphore.h
index 850ae817..dc3ca6a5 100644
--- a/src/pulsecore/semaphore.h
+++ b/src/pulsecore/semaphore.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/pulsecore/shared.c b/src/pulsecore/shared.c
index 9485dc33..edd7b7fe 100644
--- a/src/pulsecore/shared.c
+++ b/src/pulsecore/shared.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/pulsecore/shared.h b/src/pulsecore/shared.h
index f6f8d3cf..82819f07 100644
--- a/src/pulsecore/shared.h
+++ b/src/pulsecore/shared.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/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 34217c86..53e727bb 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.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
@@ -158,7 +158,6 @@ int pa_sink_input_new(
pa_return_val_if_fail(data->sink, -PA_ERR_NOENTITY);
pa_return_val_if_fail(PA_SINK_IS_LINKED(pa_sink_get_state(data->sink)), -PA_ERR_BADSTATE);
pa_return_val_if_fail(!data->sync_base || (data->sync_base->sink == data->sink && pa_sink_input_get_state(data->sync_base) == PA_SINK_INPUT_CORKED), -PA_ERR_INVALID);
- pa_return_val_if_fail(!(flags & PA_SINK_INPUT_FAIL_ON_SUSPEND) || pa_sink_get_state(data->sink) != PA_SINK_SUSPENDED, -PA_ERR_BADSTATE);
if (!data->sample_spec_is_set)
data->sample_spec = data->sink->sample_spec;
@@ -228,6 +227,12 @@ int pa_sink_input_new(
if ((r = pa_hook_fire(&core->hooks[PA_CORE_HOOK_SINK_INPUT_FIXATE], data)) < 0)
return r;
+ if ((flags & PA_SINK_INPUT_FAIL_ON_SUSPEND) &&
+ pa_sink_get_state(data->sink) == PA_SINK_SUSPENDED) {
+ pa_log_warn("Failed to create sink input: sink is suspended.");
+ return -PA_ERR_BADSTATE;
+ }
+
if (pa_idxset_size(data->sink->inputs) >= PA_MAX_INPUTS_PER_SINK) {
pa_log_warn("Failed to create sink input: too many inputs per sink.");
return -PA_ERR_TOOLARGE;
@@ -463,6 +468,8 @@ void pa_sink_input_unlink(pa_sink_input *i) {
i->sink = NULL;
}
+ pa_core_maybe_vacuum(i->core);
+
pa_sink_input_unref(i);
}
diff --git a/src/pulsecore/sink-input.h b/src/pulsecore/sink-input.h
index b4f05319..e3801687 100644
--- a/src/pulsecore/sink-input.h
+++ b/src/pulsecore/sink-input.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/pulsecore/sink.c b/src/pulsecore/sink.c
index 7441e971..ff8700c7 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/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
@@ -33,6 +33,7 @@
#include <pulse/xmalloc.h>
#include <pulse/timeval.h>
#include <pulse/util.h>
+#include <pulse/i18n.h>
#include <pulsecore/sink-input.h>
#include <pulsecore/namereg.h>
@@ -172,6 +173,9 @@ pa_sink* pa_sink_new(
if (data->card)
pa_proplist_update(data->proplist, PA_UPDATE_MERGE, data->card->proplist);
+ pa_device_init_description(data->proplist);
+ pa_device_init_icon(data->proplist, TRUE);
+
if (pa_hook_fire(&core->hooks[PA_CORE_HOOK_SINK_FIXATE], data) < 0) {
pa_xfree(s);
pa_namereg_unregister(core, name);
@@ -322,6 +326,9 @@ static int sink_set_state(pa_sink *s, pa_sink_state_t state) {
pa_sink_input_kill(i);
else if (i->suspend)
i->suspend(i, state == PA_SINK_SUSPENDED);
+
+ if (s->monitor_source)
+ pa_source_sync_suspend(s->monitor_source);
}
return 0;
@@ -1525,8 +1532,10 @@ int pa_sink_process_msg(pa_msgobject *o, int code, void *userdata, int64_t offse
s->thread_info.state = PA_PTR_TO_UINT(userdata);
- if (s->thread_info.state == PA_SINK_SUSPENDED)
+ if (s->thread_info.state == PA_SINK_SUSPENDED) {
+ s->thread_info.rewind_nbytes = 0;
s->thread_info.rewind_requested = FALSE;
+ }
return 0;
@@ -1596,8 +1605,12 @@ int pa_sink_suspend_all(pa_core *c, pa_bool_t suspend) {
pa_core_assert_ref(c);
- for (sink = PA_SINK(pa_idxset_first(c->sinks, &idx)); sink; sink = PA_SINK(pa_idxset_next(c->sinks, &idx)))
- ret -= pa_sink_suspend(sink, suspend) < 0;
+ for (sink = PA_SINK(pa_idxset_first(c->sinks, &idx)); sink; sink = PA_SINK(pa_idxset_next(c->sinks, &idx))) {
+ int r;
+
+ if ((r = pa_sink_suspend(sink, suspend)) < 0)
+ ret = r;
+ }
return ret;
}
@@ -1726,7 +1739,7 @@ pa_usec_t pa_sink_get_requested_latency(pa_sink *s) {
return usec;
}
-/* Called from IO thread */
+/* Called from IO as well as the main thread -- the latter only before the IO thread started up */
void pa_sink_set_max_rewind(pa_sink *s, size_t max_rewind) {
pa_sink_input *i;
void *state = NULL;
@@ -1747,7 +1760,7 @@ void pa_sink_set_max_rewind(pa_sink *s, size_t max_rewind) {
pa_source_set_max_rewind(s->monitor_source, s->thread_info.max_rewind);
}
-/* Called from IO thread */
+/* Called from IO as well as the main thread -- the latter only before the IO thread started up */
void pa_sink_set_max_request(pa_sink *s, size_t max_request) {
void *state = NULL;
@@ -1886,3 +1899,81 @@ size_t pa_sink_get_max_request(pa_sink *s) {
return r;
}
+
+/* Called from main context */
+pa_bool_t pa_device_init_icon(pa_proplist *p, pa_bool_t is_sink) {
+ const char *ff, *c, *t = NULL, *s = "", *profile, *bus;
+
+ pa_assert(p);
+
+ if (pa_proplist_contains(p, PA_PROP_DEVICE_ICON_NAME))
+ return TRUE;
+
+ if ((ff = pa_proplist_gets(p, PA_PROP_DEVICE_FORM_FACTOR))) {
+
+ if (pa_streq(ff, "microphone"))
+ t = "audio-input-microphone";
+ else if (pa_streq(ff, "webcam"))
+ t = "camera-web";
+ else if (pa_streq(ff, "computer"))
+ t = "computer";
+ else if (pa_streq(ff, "handset"))
+ t = "phone";
+ else if (pa_streq(ff, "portable"))
+ t = "multimedia-player";
+ }
+
+ if (!t)
+ if ((c = pa_proplist_gets(p, PA_PROP_DEVICE_CLASS)))
+ if (pa_streq(c, "modem"))
+ t = "modem";
+
+ if (!t) {
+ if (is_sink)
+ t = "audio-card";
+ else
+ t = "audio-input-microphone";
+ }
+
+ if ((profile = pa_proplist_gets(p, PA_PROP_DEVICE_PROFILE_NAME))) {
+ if (strstr(profile, "analog"))
+ s = "-analog";
+ else if (strstr(profile, "iec958"))
+ s = "-iec958";
+ else if (strstr(profile, "hdmi"))
+ s = "-hdmi";
+ }
+
+ bus = pa_proplist_gets(p, PA_PROP_DEVICE_BUS);
+
+ pa_proplist_setf(p, PA_PROP_DEVICE_ICON_NAME, "%s%s%s%s", t, pa_strempty(s), bus ? "-" : "", pa_strempty(bus));
+
+ return TRUE;
+}
+
+pa_bool_t pa_device_init_description(pa_proplist *p) {
+ const char *s;
+ pa_assert(p);
+
+ if (pa_proplist_contains(p, PA_PROP_DEVICE_DESCRIPTION))
+ return TRUE;
+
+ if ((s = pa_proplist_gets(p, PA_PROP_DEVICE_FORM_FACTOR)))
+ if (pa_streq(s, "internal")) {
+ pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, _("Internal Audio"));
+ return TRUE;
+ }
+
+ if ((s = pa_proplist_gets(p, PA_PROP_DEVICE_CLASS)))
+ if (pa_streq(s, "modem")) {
+ pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, _("Modem"));
+ return TRUE;
+ }
+
+ if ((s = pa_proplist_gets(p, PA_PROP_DEVICE_PRODUCT_NAME))) {
+ pa_proplist_sets(p, PA_PROP_DEVICE_DESCRIPTION, s);
+ return TRUE;
+ }
+
+ return FALSE;
+}
diff --git a/src/pulsecore/sink.h b/src/pulsecore/sink.h
index 124b4e11..0d33679f 100644
--- a/src/pulsecore/sink.h
+++ b/src/pulsecore/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
@@ -225,6 +225,9 @@ void pa_sink_attach(pa_sink *s);
void pa_sink_set_soft_volume(pa_sink *s, const pa_cvolume *volume);
+pa_bool_t pa_device_init_description(pa_proplist *p);
+pa_bool_t pa_device_init_icon(pa_proplist *p, pa_bool_t is_sink);
+
/**** May be called by everyone, from main context */
/* The returned value is supposed to be in the time domain of the sound card! */
diff --git a/src/pulsecore/sioman.c b/src/pulsecore/sioman.c
index 7e5b186c..24c046cf 100644
--- a/src/pulsecore/sioman.c
+++ b/src/pulsecore/sioman.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/pulsecore/sioman.h b/src/pulsecore/sioman.h
index d0cacc9b..88ff92af 100644
--- a/src/pulsecore/sioman.h
+++ b/src/pulsecore/sioman.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/pulsecore/socket-server.c b/src/pulsecore/socket-server.c
index 19c2fd09..6a4405e3 100644
--- a/src/pulsecore/socket-server.c
+++ b/src/pulsecore/socket-server.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/pulsecore/socket-server.h b/src/pulsecore/socket-server.h
index b9a2c40e..72b6eda4 100644
--- a/src/pulsecore/socket-server.h
+++ b/src/pulsecore/socket-server.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/pulsecore/socket-util.c b/src/pulsecore/socket-util.c
index e44f6460..5fd5dd67 100644
--- a/src/pulsecore/socket-util.c
+++ b/src/pulsecore/socket-util.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/pulsecore/socket-util.h b/src/pulsecore/socket-util.h
index 7a40285a..f6d16376 100644
--- a/src/pulsecore/socket-util.h
+++ b/src/pulsecore/socket-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/pulsecore/sound-file-stream.c b/src/pulsecore/sound-file-stream.c
index c3de3067..3453637f 100644
--- a/src/pulsecore/sound-file-stream.c
+++ b/src/pulsecore/sound-file-stream.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/pulsecore/sound-file-stream.h b/src/pulsecore/sound-file-stream.h
index 4cc69146..a788c342 100644
--- a/src/pulsecore/sound-file-stream.h
+++ b/src/pulsecore/sound-file-stream.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/pulsecore/sound-file.c b/src/pulsecore/sound-file.c
index 380cef16..db75ae08 100644
--- a/src/pulsecore/sound-file.c
+++ b/src/pulsecore/sound-file.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/pulsecore/sound-file.h b/src/pulsecore/sound-file.h
index e4d703d3..34e02616 100644
--- a/src/pulsecore/sound-file.h
+++ b/src/pulsecore/sound-file.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/pulsecore/source-output.c b/src/pulsecore/source-output.c
index d63aca15..373d5637 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.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
@@ -127,7 +127,6 @@ int pa_source_output_new(
pa_return_val_if_fail(data->source, -PA_ERR_NOENTITY);
pa_return_val_if_fail(PA_SOURCE_IS_LINKED(pa_source_get_state(data->source)), -PA_ERR_BADSTATE);
pa_return_val_if_fail(!data->direct_on_input || data->direct_on_input->sink == data->source->monitor_of, -PA_ERR_INVALID);
- pa_return_val_if_fail(!(flags & PA_SOURCE_OUTPUT_FAIL_ON_SUSPEND) || pa_source_get_state(data->source) != PA_SOURCE_SUSPENDED, -PA_ERR_BADSTATE);
if (!data->sample_spec_is_set)
data->sample_spec = data->source->sample_spec;
@@ -166,6 +165,12 @@ int pa_source_output_new(
if ((r = pa_hook_fire(&core->hooks[PA_CORE_HOOK_SOURCE_OUTPUT_FIXATE], data)) < 0)
return r;
+ if ((flags & PA_SOURCE_OUTPUT_FAIL_ON_SUSPEND) &&
+ pa_source_get_state(data->source) == PA_SOURCE_SUSPENDED) {
+ pa_log("Failed to create source output: source is suspended.");
+ return -PA_ERR_BADSTATE;
+ }
+
if (pa_idxset_size(data->source->outputs) >= PA_MAX_OUTPUTS_PER_SOURCE) {
pa_log("Failed to create source output: too many outputs per source.");
return -PA_ERR_TOOLARGE;
@@ -330,6 +335,8 @@ void pa_source_output_unlink(pa_source_output*o) {
o->source = NULL;
}
+ pa_core_maybe_vacuum(o->core);
+
pa_source_output_unref(o);
}
diff --git a/src/pulsecore/source-output.h b/src/pulsecore/source-output.h
index 9369568c..018ec886 100644
--- a/src/pulsecore/source-output.h
+++ b/src/pulsecore/source-output.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/pulsecore/source.c b/src/pulsecore/source.c
index c0d6d9ea..cc6dfc40 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/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
@@ -163,6 +163,9 @@ pa_source* pa_source_new(
if (data->card)
pa_proplist_update(data->proplist, PA_UPDATE_MERGE, data->card->proplist);
+ pa_device_init_description(data->proplist);
+ pa_device_init_icon(data->proplist, FALSE);
+
if (pa_hook_fire(&core->hooks[PA_CORE_HOOK_SOURCE_FIXATE], data) < 0) {
pa_xfree(s);
pa_namereg_unregister(core, name);
@@ -421,6 +424,9 @@ int pa_source_suspend(pa_source *s, pa_bool_t suspend) {
pa_source_assert_ref(s);
pa_assert(PA_SOURCE_IS_LINKED(s->state));
+ if (s->monitor_of)
+ return -PA_ERR_NOTSUPPORTED;
+
if (suspend)
return source_set_state(s, PA_SOURCE_SUSPENDED);
else
@@ -428,6 +434,24 @@ int pa_source_suspend(pa_source *s, pa_bool_t suspend) {
}
/* Called from main context */
+int pa_source_sync_suspend(pa_source *s) {
+ pa_sink_state_t state;
+
+ pa_source_assert_ref(s);
+ pa_assert(PA_SOURCE_IS_LINKED(s->state));
+ pa_assert(s->monitor_of);
+
+ state = pa_sink_get_state(s->monitor_of);
+
+ if (state == PA_SINK_SUSPENDED)
+ return source_set_state(s, PA_SOURCE_SUSPENDED);
+
+ pa_assert(PA_SINK_IS_OPENED(state));
+
+ return source_set_state(s, pa_source_used_by(s) ? PA_SOURCE_RUNNING : PA_SOURCE_IDLE);
+}
+
+/* Called from main context */
pa_queue *pa_source_move_all_start(pa_source *s) {
pa_queue *q;
pa_source_output *o, *n;
@@ -931,8 +955,15 @@ int pa_source_suspend_all(pa_core *c, pa_bool_t suspend) {
pa_core_assert_ref(c);
- for (source = PA_SOURCE(pa_idxset_first(c->sources, &idx)); source; source = PA_SOURCE(pa_idxset_next(c->sources, &idx)))
- ret -= pa_source_suspend(source, suspend) < 0;
+ for (source = PA_SOURCE(pa_idxset_first(c->sources, &idx)); source; source = PA_SOURCE(pa_idxset_next(c->sources, &idx))) {
+ int r;
+
+ if (source->monitor_of)
+ continue;
+
+ if ((r = pa_source_suspend(source, suspend)) < 0)
+ ret = r;
+ }
return ret;
}
diff --git a/src/pulsecore/source.h b/src/pulsecore/source.h
index 8a91016a..26471de0 100644
--- a/src/pulsecore/source.h
+++ b/src/pulsecore/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
@@ -212,6 +212,8 @@ void pa_source_attach(pa_source *s);
void pa_source_set_soft_volume(pa_source *s, const pa_cvolume *volume);
+int pa_source_sync_suspend(pa_source *s);
+
/*** May be called by everyone, from main context */
/* The returned value is supposed to be in the time domain of the sound card! */
diff --git a/src/pulsecore/strbuf.c b/src/pulsecore/strbuf.c
index 8b952788..9f5a84b4 100644
--- a/src/pulsecore/strbuf.c
+++ b/src/pulsecore/strbuf.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/pulsecore/strbuf.h b/src/pulsecore/strbuf.h
index 1d2a588f..05e69e03 100644
--- a/src/pulsecore/strbuf.h
+++ b/src/pulsecore/strbuf.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/pulsecore/strlist.c b/src/pulsecore/strlist.c
index f587a2f8..cbafbba6 100644
--- a/src/pulsecore/strlist.c
+++ b/src/pulsecore/strlist.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/pulsecore/strlist.h b/src/pulsecore/strlist.h
index 1cb7537a..2584e86c 100644
--- a/src/pulsecore/strlist.h
+++ b/src/pulsecore/strlist.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/pulsecore/thread-posix.c b/src/pulsecore/thread-posix.c
index ade398f9..fdab270f 100644
--- a/src/pulsecore/thread-posix.c
+++ b/src/pulsecore/thread-posix.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/pulsecore/thread-win32.c b/src/pulsecore/thread-win32.c
index c40d3342..0a1baa54 100644
--- a/src/pulsecore/thread-win32.c
+++ b/src/pulsecore/thread-win32.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/pulsecore/thread.h b/src/pulsecore/thread.h
index eabe9ba4..25eace63 100644
--- a/src/pulsecore/thread.h
+++ b/src/pulsecore/thread.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
+ 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/pulsecore/tokenizer.c b/src/pulsecore/tokenizer.c
index 07a9f3ac..1eb466dd 100644
--- a/src/pulsecore/tokenizer.c
+++ b/src/pulsecore/tokenizer.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/pulsecore/tokenizer.h b/src/pulsecore/tokenizer.h
index d51cd73e..a47c07e7 100644
--- a/src/pulsecore/tokenizer.h
+++ b/src/pulsecore/tokenizer.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/pulsecore/vector.h b/src/pulsecore/vector.h
index 076bd6c0..924e3cb8 100644
--- a/src/pulsecore/vector.h
+++ b/src/pulsecore/vector.h
@@ -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/pulsecore/x11prop.c b/src/pulsecore/x11prop.c
index 7f91ba3c..873a76e7 100644
--- a/src/pulsecore/x11prop.c
+++ b/src/pulsecore/x11prop.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/pulsecore/x11prop.h b/src/pulsecore/x11prop.h
index c5998d3e..dc675263 100644
--- a/src/pulsecore/x11prop.h
+++ b/src/pulsecore/x11prop.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/pulsecore/x11wrap.c b/src/pulsecore/x11wrap.c
index 332ebb2e..1960a12f 100644
--- a/src/pulsecore/x11wrap.c
+++ b/src/pulsecore/x11wrap.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/pulsecore/x11wrap.h b/src/pulsecore/x11wrap.h
index badc3a1f..b57541f2 100644
--- a/src/pulsecore/x11wrap.h
+++ b/src/pulsecore/x11wrap.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/tests/asyncmsgq-test.c b/src/tests/asyncmsgq-test.c
index 08ad3dd4..40c74f76 100644
--- a/src/tests/asyncmsgq-test.c
+++ b/src/tests/asyncmsgq-test.c
@@ -3,7 +3,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/tests/asyncq-test.c b/src/tests/asyncq-test.c
index 4e8a1207..a617e1a0 100644
--- a/src/tests/asyncq-test.c
+++ b/src/tests/asyncq-test.c
@@ -3,7 +3,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/tests/cpulimit-test.c b/src/tests/cpulimit-test.c
index fdc0162e..9d0f4eef 100644
--- a/src/tests/cpulimit-test.c
+++ b/src/tests/cpulimit-test.c
@@ -3,7 +3,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/tests/envelope-test.c b/src/tests/envelope-test.c
index 11a80a14..3af3044e 100644
--- a/src/tests/envelope-test.c
+++ b/src/tests/envelope-test.c
@@ -3,7 +3,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/tests/flist-test.c b/src/tests/flist-test.c
index b2c648da..64c0add2 100644
--- a/src/tests/flist-test.c
+++ b/src/tests/flist-test.c
@@ -3,7 +3,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/tests/get-binary-name-test.c b/src/tests/get-binary-name-test.c
index 7c7a8996..a34e38fd 100644
--- a/src/tests/get-binary-name-test.c
+++ b/src/tests/get-binary-name-test.c
@@ -3,7 +3,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/tests/gtk-test.c b/src/tests/gtk-test.c
index 092ba25c..f82aca58 100644
--- a/src/tests/gtk-test.c
+++ b/src/tests/gtk-test.c
@@ -3,7 +3,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/tests/interpol-test.c b/src/tests/interpol-test.c
index d7da660c..dd24e829 100644
--- a/src/tests/interpol-test.c
+++ b/src/tests/interpol-test.c
@@ -3,7 +3,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
@@ -107,6 +107,7 @@ int main(int argc, char *argv[]) {
int k, r;
struct timeval start, last_info = { 0, 0 };
pa_usec_t old_t = 0, old_rtc = 0;
+ pa_bool_t corked = FALSE;
playback = argc <= 1 || !pa_streq(argv[1], "-r");
@@ -129,7 +130,7 @@ int main(int argc, char *argv[]) {
r = pa_threaded_mainloop_start(m);
assert(r >= 0);
- for (k = 0; k < 5000; k++) {
+ for (k = 0; k < 20000; k++) {
pa_bool_t success = FALSE, changed = FALSE;
pa_usec_t t, rtc;
struct timeval now, tv;
@@ -158,6 +159,8 @@ int main(int argc, char *argv[]) {
pa_gettimeofday(&now);
if (success) {
+ pa_bool_t cork_now;
+
rtc = pa_timeval_diff(&now, &start);
printf("%i\t%llu\t%llu\t%llu\t%llu\t%u\t%u\n", k,
(unsigned long long) rtc,
@@ -170,6 +173,18 @@ int main(int argc, char *argv[]) {
fflush(stdout);
old_t = t;
old_rtc = rtc;
+
+ cork_now = (rtc / (2*PA_USEC_PER_SEC)) % 2 == 1;
+
+ if (corked != cork_now) {
+ pa_threaded_mainloop_lock(m);
+ pa_operation_unref(pa_stream_cork(stream, cork_now, NULL, NULL));
+ pa_threaded_mainloop_unlock(m);
+
+ pa_log(cork_now ? "Corking" : "Uncorking");
+
+ corked = cork_now;
+ }
}
/* Spin loop, ugly but normal usleep() is just too badly grained */
diff --git a/src/tests/lock-autospawn-test.c b/src/tests/lock-autospawn-test.c
index 80cfda6a..c754e230 100644
--- a/src/tests/lock-autospawn-test.c
+++ b/src/tests/lock-autospawn-test.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/tests/mainloop-test.c b/src/tests/mainloop-test.c
index 2580fa72..d8926233 100644
--- a/src/tests/mainloop-test.c
+++ b/src/tests/mainloop-test.c
@@ -3,7 +3,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/tests/memblock-test.c b/src/tests/memblock-test.c
index 37b5b403..9cf6c78b 100644
--- a/src/tests/memblock-test.c
+++ b/src/tests/memblock-test.c
@@ -3,7 +3,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/tests/memblockq-test.c b/src/tests/memblockq-test.c
index b01a4fd5..127fb197 100644
--- a/src/tests/memblockq-test.c
+++ b/src/tests/memblockq-test.c
@@ -3,7 +3,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/tests/mix-test.c b/src/tests/mix-test.c
index db8ac6e3..ac4b57b5 100644
--- a/src/tests/mix-test.c
+++ b/src/tests/mix-test.c
@@ -3,7 +3,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/tests/pacat-simple.c b/src/tests/pacat-simple.c
index ffe3176a..d4224e11 100644
--- a/src/tests/pacat-simple.c
+++ b/src/tests/pacat-simple.c
@@ -3,7 +3,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/tests/parec-simple.c b/src/tests/parec-simple.c
index c9d3bef5..9f19ff47 100644
--- a/src/tests/parec-simple.c
+++ b/src/tests/parec-simple.c
@@ -3,7 +3,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/tests/proplist-test.c b/src/tests/proplist-test.c
index 5526bb7e..3e723561 100644
--- a/src/tests/proplist-test.c
+++ b/src/tests/proplist-test.c
@@ -3,7 +3,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/tests/queue-test.c b/src/tests/queue-test.c
index ceae4e47..7ee2693d 100644
--- a/src/tests/queue-test.c
+++ b/src/tests/queue-test.c
@@ -3,7 +3,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/tests/remix-test.c b/src/tests/remix-test.c
index 3da4ee33..9d110d6b 100644
--- a/src/tests/remix-test.c
+++ b/src/tests/remix-test.c
@@ -3,7 +3,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/tests/resampler-test.c b/src/tests/resampler-test.c
index da8d3756..6b4a64ca 100644
--- a/src/tests/resampler-test.c
+++ b/src/tests/resampler-test.c
@@ -3,7 +3,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/tests/rtpoll-test.c b/src/tests/rtpoll-test.c
index 953fd61d..4ac96446 100644
--- a/src/tests/rtpoll-test.c
+++ b/src/tests/rtpoll-test.c
@@ -3,7 +3,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/tests/rtstutter.c b/src/tests/rtstutter.c
index d8aff342..f04d43af 100644
--- a/src/tests/rtstutter.c
+++ b/src/tests/rtstutter.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/tests/sig2str-test.c b/src/tests/sig2str-test.c
index d64a8902..0cd929ca 100644
--- a/src/tests/sig2str-test.c
+++ b/src/tests/sig2str-test.c
@@ -3,7 +3,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/tests/smoother-test.c b/src/tests/smoother-test.c
index 15700ec2..798dfed5 100644
--- a/src/tests/smoother-test.c
+++ b/src/tests/smoother-test.c
@@ -3,7 +3,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/tests/stripnul.c b/src/tests/stripnul.c
index 2b8aa083..1d8c4938 100644
--- a/src/tests/stripnul.c
+++ b/src/tests/stripnul.c
@@ -3,7 +3,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/tests/sync-playback.c b/src/tests/sync-playback.c
index f2a15601..bb64a91f 100644
--- a/src/tests/sync-playback.c
+++ b/src/tests/sync-playback.c
@@ -3,7 +3,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/tests/thread-mainloop-test.c b/src/tests/thread-mainloop-test.c
index 3bcf4f16..ad89414f 100644
--- a/src/tests/thread-mainloop-test.c
+++ b/src/tests/thread-mainloop-test.c
@@ -3,7 +3,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/tests/thread-test.c b/src/tests/thread-test.c
index f29b5e71..2c07b1cc 100644
--- a/src/tests/thread-test.c
+++ b/src/tests/thread-test.c
@@ -3,7 +3,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/tests/vector-test.c b/src/tests/vector-test.c
index f7344172..7494348c 100644
--- a/src/tests/vector-test.c
+++ b/src/tests/vector-test.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/utils/pabrowse.c b/src/utils/pabrowse.c
index f2ed9553..288d44a9 100644
--- a/src/utils/pabrowse.c
+++ b/src/utils/pabrowse.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/utils/pacat.c b/src/utils/pacat.c
index 2224da9a..e886c15c 100644
--- a/src/utils/pacat.c
+++ b/src/utils/pacat.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/utils/pacmd.c b/src/utils/pacmd.c
index 507e229f..d94f2665 100644
--- a/src/utils/pacmd.c
+++ b/src/utils/pacmd.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/utils/pactl.c b/src/utils/pactl.c
index 6524bf90..de1c6d3d 100644
--- a/src/utils/pactl.c
+++ b/src/utils/pactl.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
@@ -427,7 +427,7 @@ static void get_card_info_callback(pa_context *c, const pa_card_info *i, int is_
printf(_("\tProfiles:\n"));
for (p = i->profiles; p->name; p++)
- printf("\t\t%s: %s\n", p->name, p->description);
+ printf("\t\t%s: %s (sinks: %u, sources: %u, priority. %u)\n", p->name, p->description, p->n_sinks, p->n_sources, p->priority);
}
if (i->active_profile)
diff --git a/src/utils/padsp.c b/src/utils/padsp.c
index 76e86c8d..dfa5aac2 100644
--- a/src/utils/padsp.c
+++ b/src/utils/padsp.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/utils/paplay.c b/src/utils/paplay.c
index dec80e5c..f6ba6f6d 100644
--- a/src/utils/paplay.c
+++ b/src/utils/paplay.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/utils/pasuspender.c b/src/utils/pasuspender.c
index 8a59d5e4..b4bccd56 100644
--- a/src/utils/pasuspender.c
+++ b/src/utils/pasuspender.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/utils/pax11publish.c b/src/utils/pax11publish.c
index 50d621d4..a9eb329f 100644
--- a/src/utils/pax11publish.c
+++ b/src/utils/pax11publish.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