[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master-tx, updated. v0.9.16-test4-18-ga99e3b5

Lennart Poettering gitmailer-noreply at 0pointer.de
Mon Aug 10 12:33:59 PDT 2009


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

The master-tx branch has been updated
      from  0f77afe10f164261714a7d74a266dbab73719601 (commit)

- Log -----------------------------------------------------------------
a99e3b5 Merge commit 'origin/master-tx'
d8d2697 Merge commit 'flameeyes/master'
23a294c Correctly deal with events in the past in calc_next_timeout
9bd3398 mix-test: fix test for s24-32 samples
10e4171 Update the end-of-configuration summary for OSS output/wrapper split.
4c15115 Split OSS support in output and wrapper.
9ade136 build-sys: drop libcap checks, since we don't use caps anymore
7d49163 ladspa/remap: make sure we process all requested rewinds unconditionally
51b3899 core: save volume/mute changes coming from the hardware automatically
-----------------------------------------------------------------------

Summary of changes:
 configure.ac                                    |   70 +++++++++++----------
 src/Makefile.am                                 |    4 +-
 src/daemon/main.c                               |    2 +-
 src/modules/bluetooth/module-bluetooth-device.c |    4 +-
 src/modules/module-detect.c                     |    4 +-
 src/modules/module-hal-detect.c                 |   16 +++---
 src/modules/module-ladspa-sink.c                |    3 +
 src/modules/module-remap-sink.c                 |    3 +
 src/modules/module-tunnel.c                     |    4 +-
 src/pulse/mainloop.c                            |   13 ++--
 src/pulsecore/sink.c                            |   32 ++++++----
 src/pulsecore/sink.h                            |    4 +-
 src/pulsecore/source.c                          |   28 ++++----
 src/pulsecore/source.h                          |    4 +-
 src/tests/mix-test.c                            |   74 +++++++++++++----------
 15 files changed, 145 insertions(+), 120 deletions(-)

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

commit 51b3899348bf29dd88b56691aeea9f57895dfd14
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Aug 7 23:55:06 2009 +0200

    core: save volume/mute changes coming from the hardware automatically
    
    Volume changes coming from the lower layers are most likely changes
    triggered by the user, so let's save them automatically.

diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 0560ef3..e682997 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -1446,12 +1446,12 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *m, void *us
             if (u->sink && dbus_message_is_signal(m, "org.bluez.Headset", "SpeakerGainChanged")) {
 
                 pa_cvolume_set(&v, u->sample_spec.channels, (pa_volume_t) (gain * PA_VOLUME_NORM / 15));
-                pa_sink_volume_changed(u->sink, &v, TRUE);
+                pa_sink_volume_changed(u->sink, &v);
 
             } else if (u->source && dbus_message_is_signal(m, "org.bluez.Headset", "MicrophoneGainChanged")) {
 
                 pa_cvolume_set(&v, u->sample_spec.channels, (pa_volume_t) (gain * PA_VOLUME_NORM / 15));
-                pa_source_volume_changed(u->source, &v, TRUE);
+                pa_source_volume_changed(u->source, &v);
             }
         }
     }
diff --git a/src/modules/module-tunnel.c b/src/modules/module-tunnel.c
index f788f66..eaccea4 100644
--- a/src/modules/module-tunnel.c
+++ b/src/modules/module-tunnel.c
@@ -1165,10 +1165,10 @@ static void sink_input_info_cb(pa_pdispatch *pd, uint32_t command,  uint32_t tag
         pa_cvolume_equal(&volume, &u->sink->virtual_volume))
         return;
 
-    pa_sink_volume_changed(u->sink, &volume, FALSE);
+    pa_sink_volume_changed(u->sink, &volume);
 
     if (u->version >= 11)
-        pa_sink_mute_changed(u->sink, mute, FALSE);
+        pa_sink_mute_changed(u->sink, mute);
 
     return;
 
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index d8f3c7d..73a7062 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -1386,6 +1386,12 @@ const pa_cvolume *pa_sink_get_volume(pa_sink *s, pa_bool_t force_refresh, pa_boo
 
             s->reference_volume = s->virtual_volume;
 
+            /* Something got changed in the hardware. It probably
+             * makes sense to save changed hw settings given that hw
+             * volume changes not triggered by PA are almost certainly
+             * done by the user. */
+            s->save_volume = TRUE;
+
             if (s->flags & PA_SINK_FLAT_VOLUME)
                 pa_sink_propagate_flat_volume(s);
 
@@ -1397,17 +1403,15 @@ const pa_cvolume *pa_sink_get_volume(pa_sink *s, pa_bool_t force_refresh, pa_boo
 }
 
 /* Called from main thread */
-void pa_sink_volume_changed(pa_sink *s, const pa_cvolume *new_volume, pa_bool_t save) {
+void pa_sink_volume_changed(pa_sink *s, const pa_cvolume *new_volume) {
     pa_sink_assert_ref(s);
 
     /* The sink implementor may call this if the volume changed to make sure everyone is notified */
-    if (pa_cvolume_equal(&s->virtual_volume, new_volume)) {
-        s->save_volume = s->save_volume || save;
+    if (pa_cvolume_equal(&s->virtual_volume, new_volume))
         return;
-    }
 
     s->reference_volume = s->virtual_volume = *new_volume;
-    s->save_volume = save;
+    s->save_volume = TRUE;
 
     if (s->flags & PA_SINK_FLAT_VOLUME)
         pa_sink_propagate_flat_volume(s);
@@ -1449,6 +1453,8 @@ pa_bool_t pa_sink_get_mute(pa_sink *s, pa_bool_t force_refresh) {
         pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SINK_MESSAGE_GET_MUTE, NULL, 0, NULL) == 0);
 
         if (old_muted != s->muted) {
+            s->save_muted = TRUE;
+
             pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SINK|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
 
             /* Make sure the soft mute status stays in sync */
@@ -1456,22 +1462,21 @@ pa_bool_t pa_sink_get_mute(pa_sink *s, pa_bool_t force_refresh) {
         }
     }
 
+
     return s->muted;
 }
 
 /* Called from main thread */
-void pa_sink_mute_changed(pa_sink *s, pa_bool_t new_muted, pa_bool_t save) {
+void pa_sink_mute_changed(pa_sink *s, pa_bool_t new_muted) {
     pa_sink_assert_ref(s);
 
     /* The sink implementor may call this if the volume changed to make sure everyone is notified */
 
-    if (s->muted == new_muted) {
-        s->save_muted = s->save_muted || save;
+    if (s->muted == new_muted)
         return;
-    }
 
     s->muted = new_muted;
-    s->save_muted = save;
+    s->save_muted = TRUE;
 
     pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SINK|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
 }
diff --git a/src/pulsecore/sink.h b/src/pulsecore/sink.h
index d16fcc0..7a8cdaf 100644
--- a/src/pulsecore/sink.h
+++ b/src/pulsecore/sink.h
@@ -267,8 +267,8 @@ void pa_sink_detach(pa_sink *s);
 void pa_sink_attach(pa_sink *s);
 
 void pa_sink_set_soft_volume(pa_sink *s, const pa_cvolume *volume);
-void pa_sink_volume_changed(pa_sink *s, const pa_cvolume *new_volume, pa_bool_t save);
-void pa_sink_mute_changed(pa_sink *s, pa_bool_t new_muted, pa_bool_t save);
+void pa_sink_volume_changed(pa_sink *s, const pa_cvolume *new_volume);
+void pa_sink_mute_changed(pa_sink *s, pa_bool_t new_muted);
 
 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);
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 74f38bc..ad7462b 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -773,26 +773,26 @@ const pa_cvolume *pa_source_get_volume(pa_source *s, pa_bool_t force_refresh) {
 
         pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_GET_VOLUME, NULL, 0, NULL) == 0);
 
-        if (!pa_cvolume_equal(&old_virtual_volume, &s->virtual_volume))
+        if (!pa_cvolume_equal(&old_virtual_volume, &s->virtual_volume)) {
+            s->save_volume = TRUE;
             pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
+        }
     }
 
     return &s->virtual_volume;
 }
 
 /* Called from main thread */
-void pa_source_volume_changed(pa_source *s, const pa_cvolume *new_volume, pa_bool_t save) {
+void pa_source_volume_changed(pa_source *s, const pa_cvolume *new_volume) {
     pa_source_assert_ref(s);
 
     /* The source implementor may call this if the volume changed to make sure everyone is notified */
 
-    if (pa_cvolume_equal(&s->virtual_volume, new_volume)) {
-        s->save_volume = s->save_volume || save;
+    if (pa_cvolume_equal(&s->virtual_volume, new_volume))
         return;
-    }
 
     s->virtual_volume = *new_volume;
-    s->save_volume = save;
+    s->save_volume = TRUE;
 
     pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
 }
@@ -831,6 +831,8 @@ pa_bool_t pa_source_get_mute(pa_source *s, pa_bool_t force_refresh) {
         pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_GET_MUTE, NULL, 0, NULL) == 0);
 
         if (old_muted != s->muted) {
+            s->save_muted = TRUE;
+
             pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
 
             /* Make sure the soft mute status stays in sync */
@@ -842,18 +844,16 @@ pa_bool_t pa_source_get_mute(pa_source *s, pa_bool_t force_refresh) {
 }
 
 /* Called from main thread */
-void pa_source_mute_changed(pa_source *s, pa_bool_t new_muted, pa_bool_t save) {
+void pa_source_mute_changed(pa_source *s, pa_bool_t new_muted) {
     pa_source_assert_ref(s);
 
     /* The source implementor may call this if the mute state changed to make sure everyone is notified */
 
-    if (s->muted == new_muted) {
-        s->save_muted = s->save_muted || save;
+    if (s->muted == new_muted)
         return;
-    }
 
     s->muted = new_muted;
-    s->save_muted = save;
+    s->save_muted = TRUE;
 
     pa_subscription_post(s->core, PA_SUBSCRIPTION_EVENT_SOURCE|PA_SUBSCRIPTION_EVENT_CHANGE, s->index);
 }
diff --git a/src/pulsecore/source.h b/src/pulsecore/source.h
index 7e9fd8b..d22e7ca 100644
--- a/src/pulsecore/source.h
+++ b/src/pulsecore/source.h
@@ -237,8 +237,8 @@ void pa_source_detach(pa_source *s);
 void pa_source_attach(pa_source *s);
 
 void pa_source_set_soft_volume(pa_source *s, const pa_cvolume *volume);
-void pa_source_volume_changed(pa_source *s, const pa_cvolume *new_volume, pa_bool_t save);
-void pa_source_mute_changed(pa_source *s, pa_bool_t new_muted, pa_bool_t save);
+void pa_source_volume_changed(pa_source *s, const pa_cvolume *new_volume);
+void pa_source_mute_changed(pa_source *s, pa_bool_t new_muted);
 
 int pa_source_sync_suspend(pa_source *s);
 

commit 7d4916379bbf05384ad199004949cc220822aa5f
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Aug 7 23:58:45 2009 +0200

    ladspa/remap: make sure we process all requested rewinds unconditionally
    
    In some situations a rewind request travelling downstream might be
    optimized away on its way and an upstream rewind processing might never
    come back. Hence, call _process_rewind() before each _render()just to
    make sure we processed them all.

diff --git a/src/modules/module-ladspa-sink.c b/src/modules/module-ladspa-sink.c
index 21f4a8f..b26330c 100644
--- a/src/modules/module-ladspa-sink.c
+++ b/src/modules/module-ladspa-sink.c
@@ -178,6 +178,9 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t nbytes, pa_memchunk *chunk
     if (!u->sink || !PA_SINK_IS_OPENED(u->sink->thread_info.state))
         return -1;
 
+    /* Hmm, process any rewind request that might be queued up */
+    pa_sink_process_rewind(u->sink, 0);
+
     while (pa_memblockq_peek(u->memblockq, &tchunk) < 0) {
         pa_memchunk nchunk;
 
diff --git a/src/modules/module-remap-sink.c b/src/modules/module-remap-sink.c
index 119f5b9..0b7b9b8 100644
--- a/src/modules/module-remap-sink.c
+++ b/src/modules/module-remap-sink.c
@@ -148,6 +148,9 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t nbytes, pa_memchunk *chunk
     if (!u->sink || !PA_SINK_IS_OPENED(u->sink->thread_info.state))
         return -1;
 
+    /* Hmm, process any rewind request that might be queued up */
+    pa_sink_process_rewind(u->sink, 0);
+
     pa_sink_render(u->sink, nbytes, chunk);
     return 0;
 }
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 73a7062..5e9662c 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -665,11 +665,14 @@ void pa_sink_move_all_fail(pa_queue *q) {
 void pa_sink_process_rewind(pa_sink *s, size_t nbytes) {
     pa_sink_input *i;
     void *state = NULL;
+
     pa_sink_assert_ref(s);
     pa_assert(PA_SINK_IS_LINKED(s->thread_info.state));
 
     /* If nobody requested this and this is actually no real rewind
-     * then we can short cut this */
+     * then we can short cut this. Please note that this means that
+     * not all rewind requests triggered upstream will always be
+     * translated in actual requests! */
     if (!s->thread_info.rewind_requested && nbytes <= 0)
         return;
 
@@ -682,7 +685,7 @@ void pa_sink_process_rewind(pa_sink *s, size_t nbytes) {
     if (nbytes > 0)
         pa_log_debug("Processing rewind...");
 
-    while ((i = pa_hashmap_iterate(s->thread_info.inputs, &state, NULL))) {
+    PA_HASHMAP_FOREACH(i, s->thread_info.inputs, state) {
         pa_sink_input_assert_ref(i);
         pa_sink_input_process_rewind(i, nbytes);
     }
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index ad7462b..b8af148 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -592,15 +592,15 @@ void pa_source_process_rewind(pa_source *s, size_t nbytes) {
     pa_source_assert_ref(s);
     pa_assert(PA_SOURCE_IS_LINKED(s->thread_info.state));
 
-    if (s->thread_info.state == PA_SOURCE_SUSPENDED)
+    if (nbytes <= 0)
         return;
 
-    if (nbytes <= 0)
+    if (s->thread_info.state == PA_SOURCE_SUSPENDED)
         return;
 
     pa_log_debug("Processing rewind...");
 
-    while ((o = pa_hashmap_iterate(s->thread_info.outputs, &state, NULL))) {
+    PA_HASHMAP_FOREACH(o, s->thread_info.outputs, state) {
         pa_source_output_assert_ref(o);
         pa_source_output_process_rewind(o, nbytes);
     }

commit 9ade13604e98378e68a82b82ba260869714474b4
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Aug 8 01:37:32 2009 +0200

    build-sys: drop libcap checks, since we don't use caps anymore

diff --git a/configure.ac b/configure.ac
index 179aeb3..4079213 100644
--- a/configure.ac
+++ b/configure.ac
@@ -537,25 +537,6 @@ AC_SUBST(X11_LIBS)
 AC_SUBST(HAVE_X11)
 AM_CONDITIONAL([HAVE_X11], [test "x$HAVE_X11" = x1])
 
-#### Capabilities (optional) ####
-
-CAP_LIBS=''
-
-AC_ARG_WITH(
-        [caps],
-        AS_HELP_STRING([--without-caps],[Omit support for POSIX capabilities.]))
-
-if test "x${with_caps}" != "xno"; then
-    AC_SEARCH_LIBS([cap_init], [cap], [], [
-                    if test "x${with_caps}" = "xyes" ; then
-                        AC_MSG_ERROR([*** POSIX caps libraries not found])
-                    fi])
-    AC_CHECK_HEADERS([sys/capability.h], [], [
-                    if test "x${with_caps}" = "xyes" ; then
-                        AC_MSG_ERROR([*** POSIX caps headers not found])
-                    fi])
-fi
-
 #### Valgrind (optional) ####
 
 AC_CHECK_HEADERS_ONCE([valgrind/memcheck.h])

commit 4c1511500759c7701b407227e907c0e5c8e38763
Author: Diego Elio 'Flameeyes' Pettenò <flameeyes at gmail.com>
Date:   Sat Aug 8 01:53:15 2009 +0200

    Split OSS support in output and wrapper.
    
    Since Fedora does not enable OSS output support at all, but still uses
    padsp, and in Gentoo we could also make use of padsp without OSS output
    support, split the two things in two parameters, although they both check
    for sys/soundcard.h once.

diff --git a/configure.ac b/configure.ac
index 4079213..f703479 100644
--- a/configure.ac
+++ b/configure.ac
@@ -664,26 +664,42 @@ AM_CONDITIONAL([HAVE_GDBM], [test "x$HAVE_GDBM" = x1])
 
 #### OSS support (optional) ####
 
-AC_ARG_ENABLE([oss],
-    AS_HELP_STRING([--disable-oss],[Disable optional OSS support]),
+AC_ARG_ENABLE([oss-output],
+    AS_HELP_STRING([--disable-oss-output],[Disable optional OSS output support]),
         [
             case "${enableval}" in
-                yes) oss=yes ;;
-                no) oss=no ;;
-                *) AC_MSG_ERROR(bad value ${enableval} for --disable-oss) ;;
+                yes) oss_output=yes ;;
+                no) oss_output=no ;;
+                *) AC_MSG_ERROR(bad value ${enableval} for --disable-oss-output) ;;
             esac
         ],
-        [oss=auto])
+        [oss_output=auto])
 
-if test "x${oss}" != xno ; then
+AC_ARG_ENABLE([oss-wrapper],
+    AS_HELP_STRING([--disable-oss-wrapper],[Disable optional OSS wrapper support]),
+        [
+            case "${enableval}" in
+                yes) oss_wrapper=yes ;;
+                no) oss_wrapper=no ;;
+                *) AC_MSG_ERROR(bad value ${enableval} for --disable-oss-wrapper) ;;
+            esac
+        ],
+        [oss_wrapper=auto])
+
+if test "x${oss_output}" != xno || test "x${oss_wrapper}" != "xno"; then
     AC_CHECK_HEADERS([sys/soundcard.h],
         [
+            if test "x${oss_output}" != "xno"; then
+                AC_DEFINE([HAVE_OSS_OUTPUT], 1, [Have OSS output?])
+            fi
+            if test "x${oss_wrapper}" != "xno"; then
+                AC_DEFINE([HAVE_OSS_WRAPPER], 1, [Have OSS wrapper (padsp)?])
+            fi
             HAVE_OSS=1
-            AC_DEFINE([HAVE_OSS], 1, [Have OSS?])
         ],
         [
             HAVE_OSS=0
-            if test "x$oss" = xyes ; then
+            if test "x$oss_output" = xyes || test "x$oss_wrapper" = "xyes"; then
                 AC_MSG_ERROR([*** OSS support not found])
             fi
         ])
@@ -692,8 +708,8 @@ else
 fi
 
 AC_SUBST(HAVE_OSS)
-AM_CONDITIONAL([HAVE_OSS], [test "x$HAVE_OSS" = x1])
-
+AM_CONDITIONAL([HAVE_OSS_OUTPUT], [test "x$HAVE_OSS" = x1 && test "x${oss_output}" != "xno"])
+AM_CONDITIONAL([HAVE_OSS_WRAPPER], [test "x$HAVE_OSS" = x1 && test "x${oss_wrapper}" != "xno"])
 
 #### ALSA support (optional) ####
 
diff --git a/src/Makefile.am b/src/Makefile.am
index c022fa7..5d71157 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -776,7 +776,7 @@ libpulse_mainloop_glib_la_LDFLAGS = $(AM_LDFLAGS) $(VERSIONING_LDFLAGS) -version
 #         OSS emulation           #
 ###################################
 
-if HAVE_OSS
+if HAVE_OSS_WRAPPER
 lib_LTLIBRARIES += libpulsedsp.la
 bin_SCRIPTS += utils/padsp
 endif
@@ -1031,7 +1031,7 @@ modlibexec_LTLIBRARIES += \
 		module-x11-cork-request.la
 endif
 
-if HAVE_OSS
+if HAVE_OSS_OUTPUT
 modlibexec_LTLIBRARIES += \
 		liboss-util.la \
 		module-oss.la
diff --git a/src/daemon/main.c b/src/daemon/main.c
index b209c51..7a95195 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -113,7 +113,7 @@ int allow_severity = LOG_INFO;
 int deny_severity = LOG_WARNING;
 #endif
 
-#ifdef HAVE_OSS
+#ifdef HAVE_OSS_WRAPPER
 /* padsp looks for this symbol in the running process and disables
  * itself if it finds it and it is set to 7 (which is actually a bit
  * mask). For details see padsp. */
diff --git a/src/modules/module-detect.c b/src/modules/module-detect.c
index 18479df..956fe4c 100644
--- a/src/modules/module-detect.c
+++ b/src/modules/module-detect.c
@@ -119,7 +119,7 @@ static int detect_alsa(pa_core *c, int just_one) {
 }
 #endif
 
-#ifdef HAVE_OSS
+#ifdef HAVE_OSS_OUTPUT
 static int detect_oss(pa_core *c, int just_one) {
     FILE *f;
     int n = 0, b = 0;
@@ -240,7 +240,7 @@ int pa__init(pa_module*m) {
 #ifdef HAVE_ALSA
     if ((n = detect_alsa(m->core, just_one)) <= 0)
 #endif
-#ifdef HAVE_OSS
+#ifdef HAVE_OSS_OUTPUT
     if ((n = detect_oss(m->core, just_one)) <= 0)
 #endif
 #ifdef HAVE_SOLARIS
diff --git a/src/modules/module-hal-detect.c b/src/modules/module-hal-detect.c
index 79758b9..b5b2aaf 100644
--- a/src/modules/module-hal-detect.c
+++ b/src/modules/module-hal-detect.c
@@ -55,14 +55,14 @@ PA_MODULE_AUTHOR("Shahms King");
 PA_MODULE_DESCRIPTION("Detect available audio hardware and load matching drivers");
 PA_MODULE_VERSION(PACKAGE_VERSION);
 PA_MODULE_LOAD_ONCE(TRUE);
-#if defined(HAVE_ALSA) && defined(HAVE_OSS)
+#if defined(HAVE_ALSA) && defined(HAVE_OSS_OUTPUT)
 PA_MODULE_USAGE("api=<alsa or oss> "
                 "tsched=<enable system timer based scheduling mode?>"
                 "subdevs=<init all subdevices>");
 #elif defined(HAVE_ALSA)
 PA_MODULE_USAGE("api=<alsa> "
                 "tsched=<enable system timer based scheduling mode?>");
-#elif defined(HAVE_OSS)
+#elif defined(HAVE_OSS_OUTPUT)
 PA_MODULE_USAGE("api=<oss>"
                 "subdevs=<init all subdevices>");
 #endif
@@ -84,7 +84,7 @@ struct userdata {
 #ifdef HAVE_ALSA
     pa_bool_t use_tsched;
 #endif
-#ifdef HAVE_OSS
+#ifdef HAVE_OSS_OUTPUT
     pa_bool_t init_subdevs;
 #endif
 };
@@ -97,7 +97,7 @@ static const char* const valid_modargs[] = {
 #ifdef HAVE_ALSA
     "tsched",
 #endif
-#ifdef HAVE_OSS
+#ifdef HAVE_OSS_OUTPUT
     "subdevs",
 #endif
     NULL
@@ -270,7 +270,7 @@ fail:
 
 #endif
 
-#ifdef HAVE_OSS
+#ifdef HAVE_OSS_OUTPUT
 
 static pa_bool_t hal_oss_device_is_pcm(LibHalContext *context, const char *udi, pa_bool_t init_subdevices) {
     char *class = NULL, *dev = NULL, *e;
@@ -402,7 +402,7 @@ static struct device* hal_device_add(struct userdata *u, const char *udi) {
     if (pa_streq(u->capability, CAPABILITY_ALSA))
         r = hal_device_load_alsa(u, udi,  d);
 #endif
-#ifdef HAVE_OSS
+#ifdef HAVE_OSS_OUTPUT
     if (pa_streq(u->capability, CAPABILITY_OSS))
         r = hal_device_load_oss(u, udi, d);
 #endif
@@ -761,7 +761,7 @@ int pa__init(pa_module*m) {
     api = pa_modargs_get_value(ma, "api", "oss");
 #endif
 
-#ifdef HAVE_OSS
+#ifdef HAVE_OSS_OUTPUT
     if (pa_streq(api, "oss"))
         u->capability = CAPABILITY_OSS;
 #endif
@@ -771,7 +771,7 @@ int pa__init(pa_module*m) {
         goto fail;
     }
 
-#ifdef HAVE_OSS
+#ifdef HAVE_OSS_OUTPUT
     if (pa_modargs_get_value_boolean(ma, "subdevs", &u->init_subdevs) < 0) {
         pa_log("Failed to parse subdevs argument.");
         goto fail;

commit 10e4171265381f250c7f243d566b4c0b937b86e1
Author: Diego Elio 'Flameeyes' Pettenò <flameeyes at gmail.com>
Date:   Sat Aug 8 02:09:26 2009 +0200

    Update the end-of-configuration summary for OSS output/wrapper split.

diff --git a/configure.ac b/configure.ac
index f703479..db73d91 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1356,9 +1356,15 @@ if test "x$HAVE_X11" = "x1" ; then
    ENABLE_X11=yes
 fi
 
-ENABLE_OSS=no
+ENABLE_OSS_OUTPUT=no
+ENABLE_OSS_WRAPPER=no
 if test "x$HAVE_OSS" = "x1" ; then
-   ENABLE_OSS=yes
+   if test "x$enable_oss_output" != "xno"; then
+      ENABLE_OSS_OUTPUT=yes
+   fi
+   if test "x$enable_oss_wrapper" != "xno"; then
+      ENABLE_OSS_WRAPPER=yes
+   fi
 fi
 
 ENABLE_ALSA=no
@@ -1469,7 +1475,8 @@ echo "
     CFLAGS:                        ${CFLAGS}
 
     Have X11:                      ${ENABLE_X11}
-    Enable OSS:                    ${ENABLE_OSS}
+    Enable OSS Output:             ${ENABLE_OSS_OUTPUT}
+    Enable OSS Wrapper:            ${ENABLE_OSS_WRAPPER}
     Enable Alsa:                   ${ENABLE_ALSA}
     Enable Solaris:                ${ENABLE_SOLARIS}
     Enable GLib 2.0:               ${ENABLE_GLIB20}

commit 9bd3398f94114387dc91bf930bdad90d58711e88
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Aug 8 04:30:42 2009 +0200

    mix-test: fix test for s24-32 samples

diff --git a/src/tests/mix-test.c b/src/tests/mix-test.c
index 3f65cba..f9f76da 100644
--- a/src/tests/mix-test.c
+++ b/src/tests/mix-test.c
@@ -69,6 +69,8 @@ static void dump_block(const pa_sample_spec *ss, const pa_memchunk *chunk) {
             break;
         }
 
+        case PA_SAMPLE_S24_32NE:
+        case PA_SAMPLE_S24_32RE:
         case PA_SAMPLE_S32NE:
         case PA_SAMPLE_S32RE: {
             uint32_t *u = d;
@@ -84,7 +86,7 @@ static void dump_block(const pa_sample_spec *ss, const pa_memchunk *chunk) {
             uint8_t *u = d;
 
             for (i = 0; i < chunk->length / pa_frame_size(ss); i++) {
-	        printf("0x%02x%02x%02xx ", *u, *(u+1), *(u+2));
+                printf("0x%02x%02x%02xx ", *u, *(u+1), *(u+2));
                 u += 3;
             }
 
@@ -125,66 +127,72 @@ static pa_memblock* generate_block(pa_mempool *pool, const pa_sample_spec *ss) {
         case PA_SAMPLE_U8:
         case PA_SAMPLE_ULAW:
         case PA_SAMPLE_ALAW: {
-	    static const uint8_t u8_samples[] =
-	      { 0x00, 0xFF, 0x7F, 0x80, 0x9f,
-		0x3f, 0x01, 0xF0, 0x20, 0x21 };
+            static const uint8_t u8_samples[] = {
+                0x00, 0xFF, 0x7F, 0x80, 0x9f,
+                0x3f, 0x01, 0xF0, 0x20, 0x21
+            };
 
-	    memcpy(d, &u8_samples[0], sizeof(u8_samples));
+            memcpy(d, u8_samples, sizeof(u8_samples));
             break;
         }
 
         case PA_SAMPLE_S16NE:
         case PA_SAMPLE_S16RE: {
-	    static const uint16_t u16_samples[] =
-	      { 0x0000, 0xFFFF, 0x7FFF, 0x8000, 0x9fff,
-		0x3fff, 0x0001, 0xF000, 0x0020, 0x0021 };
+            static const uint16_t u16_samples[] = {
+                0x0000, 0xFFFF, 0x7FFF, 0x8000, 0x9fff,
+                0x3fff, 0x0001, 0xF000, 0x0020, 0x0021
+            };
 
-	    memcpy(d, &u16_samples[0], sizeof(u16_samples));
+            memcpy(d, u16_samples, sizeof(u16_samples));
             break;
         }
 
+        case PA_SAMPLE_S24_32NE:
+        case PA_SAMPLE_S24_32RE:
         case PA_SAMPLE_S32NE:
         case PA_SAMPLE_S32RE: {
-	    static const uint32_t u32_samples[] =
-	      { 0x00000001, 0xFFFF0002, 0x7FFF0003, 0x80000004, 0x9fff0005,
-		0x3fff0006, 0x00010007, 0xF0000008, 0x00200009, 0x0021000A };
+            static const uint32_t u32_samples[] = {
+                0x00000001, 0xFFFF0002, 0x7FFF0003, 0x80000004, 0x9fff0005,
+                0x3fff0006, 0x00010007, 0xF0000008, 0x00200009, 0x0021000A
+            };
 
-	    memcpy(d, &u32_samples[0], sizeof(u32_samples));
+            memcpy(d, u32_samples, sizeof(u32_samples));
             break;
         }
 
         case PA_SAMPLE_S24NE:
         case PA_SAMPLE_S24RE: {
-	    /* Need to be on a byte array because they are not aligned */
-	    static const uint8_t u24_samples[] =
-	      { 0x00, 0x00, 0x01,
-		0xFF, 0xFF, 0x02,
-		0x7F, 0xFF, 0x03,
-		0x80, 0x00, 0x04,
-		0x9f, 0xff, 0x05,
-		0x3f, 0xff, 0x06,
-		0x01, 0x00, 0x07,
-		0xF0, 0x00, 0x08,
-		0x20, 0x00, 0x09,
-		0x21, 0x00, 0x0A };
-
-	    memcpy(d, &u24_samples[0], sizeof(u24_samples));
+            /* Need to be on a byte array because they are not aligned */
+            static const uint8_t u24_samples[] = {
+                0x00, 0x00, 0x01,
+                0xFF, 0xFF, 0x02,
+                0x7F, 0xFF, 0x03,
+                0x80, 0x00, 0x04,
+                0x9f, 0xff, 0x05,
+                0x3f, 0xff, 0x06,
+                0x01, 0x00, 0x07,
+                0xF0, 0x00, 0x08,
+                0x20, 0x00, 0x09,
+                0x21, 0x00, 0x0A
+            };
+
+            memcpy(d, u24_samples, sizeof(u24_samples));
             break;
         }
 
         case PA_SAMPLE_FLOAT32NE:
         case PA_SAMPLE_FLOAT32RE: {
             float *u = d;
-	    static const float float_samples[] =
-	      { 0.0f, -1.0f, 1.0f, 4711.0f, 0.222f,
-		0.33f, -.3f, 99.0f, -0.555f, -.123f };
+            static const float float_samples[] = {
+                0.0f, -1.0f, 1.0f, 4711.0f, 0.222f,
+                0.33f, -.3f, 99.0f, -0.555f, -.123f
+            };
 
             if (ss->format == PA_SAMPLE_FLOAT32RE) {
                 for (i = 0; i < 10; i++)
                     u[i] = swap_float(float_samples[i]);
-	    } else {
-	      memcpy(d, &float_samples[0], sizeof(float_samples));
-	    }
+            } else
+              memcpy(d, float_samples, sizeof(float_samples));
 
             break;
         }

commit 23a294c97e62e0bee9b17b1f8ad20a39e1ba15da
Author: Maxim Levitsky <maximlevitsky at gmail.com>
Date:   Sun Aug 9 03:01:08 2009 +0300

    Correctly deal with events in the past in calc_next_timeout
    
    pa_usec_t is unsigned, thus it will always be >= 0
    This makes gstreamer pulse mixer work again
    
    This fixes a gstreamer mixer regression, when it can't control the volume,
    after few changes.

diff --git a/src/pulse/mainloop.c b/src/pulse/mainloop.c
index c418d10..93a4742 100644
--- a/src/pulse/mainloop.c
+++ b/src/pulse/mainloop.c
@@ -765,23 +765,22 @@ static pa_time_event* find_next_time_event(pa_mainloop *m) {
 
 static int calc_next_timeout(pa_mainloop *m) {
     pa_time_event *t;
-    pa_usec_t usec;
+    pa_usec_t clock_now;
 
     if (!m->n_enabled_time_events)
         return -1;
 
-    t = find_next_time_event(m);
-    pa_assert(t);
+    pa_assert_se(t = find_next_time_event(m));
 
-    if (t->time == 0)
+    if (t->time <= 0)
         return 0;
 
-    usec = t->time - pa_rtclock_now();
+    clock_now = pa_rtclock_now();
 
-    if (usec <= 0)
+    if (t->time <= clock_now)
         return 0;
 
-    return (int) (usec / 1000); /* in milliseconds */
+    return (int) ((t->time - clock_now) / 1000); /* in milliseconds */
 }
 
 static int dispatch_timeout(pa_mainloop *m) {

commit d8d26979facaf4b3603e795b2320811daa7ac263
Merge: 23a294c 10e4171
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Aug 10 21:33:42 2009 +0200

    Merge commit 'flameeyes/master'


commit a99e3b54914b760fd19c7834a108e78b24e71921
Merge: d8d2697 0f77afe
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Aug 10 21:34:03 2009 +0200

    Merge commit 'origin/master-tx'


-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list