[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.15-85-g7f767e5

Lennart Poettering gitmailer-noreply at 0pointer.de
Thu May 7 17:18:32 PDT 2009


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

The master branch has been updated
      from  8d9c26e3b6d29d3922a7cc740f273e34ea97498e (commit)

- Log -----------------------------------------------------------------
7f767e5 core: liberalize 99a6a4 a bit
-----------------------------------------------------------------------

Summary of changes:
 src/pulsecore/sink.c   |   16 ++++++++++------
 src/pulsecore/source.c |   10 +++++++---
 2 files changed, 17 insertions(+), 9 deletions(-)

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

commit 7f767e5fe660ced7e1cb0207ef0477818152d833
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri May 8 02:16:10 2009 +0200

    core: liberalize 99a6a4 a bit
    
    While flags should generally be initialized by passing them to
    pa_{sink|source}_new() we make an exception for the volume related flags
    which may be initilized afterwards, but before _put().

diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 0f594da..67bdbb6 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -184,12 +184,6 @@ pa_sink* pa_sink_new(
         return NULL;
     }
 
-    if (!(flags & PA_SINK_HW_VOLUME_CTRL))
-        flags |= PA_SINK_DECIBEL_VOLUME;
-
-    if ((flags & PA_SINK_DECIBEL_VOLUME) && core->flat_volumes)
-        flags |= PA_SINK_FLAT_VOLUME;
-
     s->parent.parent.free = sink_free;
     s->parent.process_msg = pa_sink_process_msg;
 
@@ -357,6 +351,16 @@ void pa_sink_put(pa_sink* s) {
     pa_assert(s->rtpoll);
     pa_assert(s->thread_info.min_latency <= s->thread_info.max_latency);
 
+    /* Generally, flags should be initialized via pa_sink_new(). As a
+     * special exception we allow volume related flags to be set
+     * between _new() and _put(). */
+
+    if (!(s->flags & PA_SINK_HW_VOLUME_CTRL))
+        s->flags |= PA_SINK_DECIBEL_VOLUME;
+
+    if ((s->flags & PA_SINK_DECIBEL_VOLUME) && s->core->flat_volumes)
+        s->flags |= PA_SINK_FLAT_VOLUME;
+
     s->thread_info.soft_volume = s->soft_volume;
     s->thread_info.soft_muted = s->muted;
 
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 47bc5fb..8aeb560 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -174,9 +174,6 @@ pa_source* pa_source_new(
         return NULL;
     }
 
-    if (!(flags & PA_SOURCE_HW_VOLUME_CTRL))
-        flags |= PA_SOURCE_DECIBEL_VOLUME;
-
     s->parent.parent.free = source_free;
     s->parent.process_msg = pa_source_process_msg;
 
@@ -311,6 +308,13 @@ void pa_source_put(pa_source *s) {
     pa_assert(s->rtpoll);
     pa_assert(s->thread_info.min_latency <= s->thread_info.max_latency);
 
+    /* Generally, flags should be initialized via pa_source_new(). As
+     * a special exception we allow volume related flags to be set
+     * between _new() and _put(). */
+
+    if (!(s->flags & PA_SOURCE_HW_VOLUME_CTRL))
+        s->flags |= PA_SOURCE_DECIBEL_VOLUME;
+
     s->thread_info.soft_volume = s->soft_volume;
     s->thread_info.soft_muted = s->muted;
 

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list