[pulseaudio-commits] 4 commits - src/modules src/pulsecore

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


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

New commits:
commit 21ac93e4ebc160473e2e58f90a173ca0703e34e6
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-sink.c b/src/modules/module-combine-sink.c
index 76ffbd5..72ee83c 100644
--- a/src/modules/module-combine-sink.c
+++ b/src/modules/module-combine-sink.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 249218b944ed0237ec66d56c08ed4dddf5e98d24
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-sink.c b/src/modules/module-combine-sink.c
index c5c33f2..76ffbd5 100644
--- a/src/modules/module-combine-sink.c
+++ b/src/modules/module-combine-sink.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 ab808930ef29a34bd8f0b872993bb900c8f45961
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-sink.c b/src/modules/module-combine-sink.c
index f6d6453..c5c33f2 100644
--- a/src/modules/module-combine-sink.c
+++ b/src/modules/module-combine-sink.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 51d53016f39c8a7f84cd1038f0ac776a16c3de07
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 f4f3258..553e3d9 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -1662,6 +1662,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 0bb8899..963ef06 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -838,6 +838,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