[pulseaudio-commits] Branch 'stable-queue' - 4 commits - src/modules src/pulsecore

Colin Guthrie colin at kemper.freedesktop.org
Sun Jun 5 12:26:31 PDT 2011


 src/modules/module-combine.c  |   21 ++++++++++++++-------
 src/pulsecore/sink-input.c    |    1 +
 src/pulsecore/source-output.c |    1 +
 3 files changed, 16 insertions(+), 7 deletions(-)

New commits:
commit b54a43a8cf416da19e11de053c9848b119e34613
Author: Forest Bond <forest.bond at rapidrollout.com>
Date:   Fri May 20 12:16:54 2011 -0400

    module-combine-sink: Check running flag before rendering in null mode
    
    This makes process_render_null consistent with render_memblock and
    avoids introducing slight inaccuracies in early latency estimates.

diff --git a/src/modules/module-combine.c b/src/modules/module-combine.c
index aec774e..1343b70 100644
--- a/src/modules/module-combine.c
+++ b/src/modules/module-combine.c
@@ -261,6 +261,10 @@ static void process_render_null(struct userdata *u, pa_usec_t now) {
     size_t ate = 0;
     pa_assert(u);
 
+    /* If we are not running, we cannot produce any data */
+    if (!pa_atomic_load(&u->thread_info.running))
+        return;
+
     if (u->thread_info.in_null_mode)
         u->thread_info.timestamp = now;
 

commit 8a437ee5e19b38431ca6bccfd6676fcc23c88f0c
Author: Forest Bond <forest.bond at rapidrollout.com>
Date:   Fri May 20 12:21:13 2011 -0400

    module-combine-sink: Initialize smoother in paused state
    
    The smoother is paused on initialization and resumed when the sink
    state is set to running.  Otherwise, early latency estimates are
    too low since there is some delay between module initialization and
    entering the running state.
    
    After the smoother is initially resumed, it is paused when the sink
    state is not running.  The previous behavior was to pause only when
    the sink enters suspended state, however, this would lead to large
    errors in latency estimates after the sink has been idle for some
    time.

diff --git a/src/modules/module-combine.c b/src/modules/module-combine.c
index f230bda..aec774e 100644
--- a/src/modules/module-combine.c
+++ b/src/modules/module-combine.c
@@ -732,15 +732,18 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
 
     switch (code) {
 
-        case PA_SINK_MESSAGE_SET_STATE:
-            pa_atomic_store(&u->thread_info.running, PA_PTR_TO_UINT(data) == PA_SINK_RUNNING);
+        case PA_SINK_MESSAGE_SET_STATE: {
+            pa_bool_t running = (PA_PTR_TO_UINT(data) == PA_SINK_RUNNING);
 
-            if (PA_PTR_TO_UINT(data) == PA_SINK_SUSPENDED)
-                pa_smoother_pause(u->thread_info.smoother, pa_rtclock_now());
-            else
+            pa_atomic_store(&u->thread_info.running, running);
+
+            if (running)
                 pa_smoother_resume(u->thread_info.smoother, pa_rtclock_now(), TRUE);
+            else
+                pa_smoother_pause(u->thread_info.smoother, pa_rtclock_now());
 
             break;
+        }
 
         case PA_SINK_MESSAGE_GET_LATENCY: {
             pa_usec_t x, y, c, *delay = data;
@@ -1160,7 +1163,7 @@ int pa__init(pa_module*m) {
             TRUE,
             10,
             pa_rtclock_now(),
-            FALSE);
+            TRUE);
 
     adjust_time_sec = DEFAULT_ADJUST_TIME_USEC / PA_USEC_PER_SEC;
     if (pa_modargs_get_value_u32(ma, "adjust_time", &adjust_time_sec) < 0) {

commit cc91a8f4b4c1108d2e11d27bb931651b8ee9b41f
Author: Forest Bond <forest.bond at rapidrollout.com>
Date:   Fri May 20 12:07:05 2011 -0400

    module-combine-sink: Initialize smoother with offset pa_rtclock_now()
    
    The smoother was being initialized with offset zero, which caused
    the sink latency to be unconditionally reported as zero.

diff --git a/src/modules/module-combine.c b/src/modules/module-combine.c
index 3104ed6..f230bda 100644
--- a/src/modules/module-combine.c
+++ b/src/modules/module-combine.c
@@ -1159,7 +1159,7 @@ int pa__init(pa_module*m) {
             TRUE,
             TRUE,
             10,
-            0,
+            pa_rtclock_now(),
             FALSE);
 
     adjust_time_sec = DEFAULT_ADJUST_TIME_USEC / PA_USEC_PER_SEC;

commit d4c9ad179b9cc15e5ec9ede4444a447c4505421f
Author: Colin Guthrie <colin at mageia.org>
Date:   Thu Jun 2 11:44:21 2011 +0200

    streams: Fix the actual resampler method shown in debug messages.

diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 3c957f1..7833421 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -1309,6 +1309,7 @@ int pa_sink_input_finish_move(pa_sink_input *i, pa_sink *dest, pa_bool_t save) {
                 1,
                 0,
                 &i->sink->silence);
+        i->actual_resample_method = new_resampler ? pa_resampler_get_method(new_resampler) : PA_RESAMPLER_INVALID;
     }
     pa_sink_update_status(dest);
 
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index 57ccc06..3608986 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -833,6 +833,7 @@ int pa_source_output_finish_move(pa_source_output *o, pa_source *dest, pa_bool_t
                 1,
                 0,
                 &o->source->silence);
+        o->actual_resample_method = new_resampler ? pa_resampler_get_method(new_resampler) : PA_RESAMPLER_INVALID;
     }
 
     pa_source_update_status(dest);



More information about the pulseaudio-commits mailing list