[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.16-test4-74-ge5b08a8

Lennart Poettering gitmailer-noreply at 0pointer.de
Fri Aug 14 18:47:33 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  d8a90a390041b5603a7caacaaea8296fa76363bc (commit)

- Log -----------------------------------------------------------------
e5b08a8 ladspa/remap: sync latency flags from master sink when moving between sinks
0c08dbd core: introduce pa_{sink|source}_update_flags()
-----------------------------------------------------------------------

Summary of changes:
 src/modules/module-ladspa-sink.c |    1 +
 src/modules/module-remap-sink.c  |    1 +
 src/pulsecore/sink.c             |   22 +++++++++++++++++++++-
 src/pulsecore/sink.h             |    2 ++
 src/pulsecore/source.c           |   18 ++++++++++++++++--
 src/pulsecore/source.h           |    2 ++
 6 files changed, 43 insertions(+), 3 deletions(-)

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

commit 0c08dbd9b926ec94084dd47069627ed6eda1c1d1
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Aug 15 03:41:13 2009 +0200

    core: introduce pa_{sink|source}_update_flags()

diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index c1589f2..c79aa79 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -551,7 +551,7 @@ static void sink_free(pa_object *o) {
     pa_xfree(s);
 }
 
-/* Called from main context */
+/* Called from main context, and not while the IO thread is active, please */
 void pa_sink_set_asyncmsgq(pa_sink *s, pa_asyncmsgq *q) {
     pa_sink_assert_ref(s);
     pa_assert_ctl_context();
@@ -562,6 +562,26 @@ void pa_sink_set_asyncmsgq(pa_sink *s, pa_asyncmsgq *q) {
         pa_source_set_asyncmsgq(s->monitor_source, q);
 }
 
+/* Called from main context, and not while the IO thread is active, please */
+void pa_sink_update_flags(pa_sink *s, pa_sink_flags_t mask, pa_sink_flags_t value) {
+    pa_sink_assert_ref(s);
+    pa_assert_ctl_context();
+
+    if (mask == 0)
+        return;
+
+    /* For now, allow only a minimal set of flags to be changed. */
+    pa_assert((mask & ~(PA_SINK_DYNAMIC_LATENCY|PA_SINK_LATENCY)) == 0);
+
+    s->flags = (s->flags & ~mask) | (value & mask);
+
+    pa_source_update_flags(s->monitor_source,
+                           ((mask & PA_SINK_LATENCY) ? PA_SOURCE_LATENCY : 0) |
+                           ((mask & PA_SINK_DYNAMIC_LATENCY) ? PA_SOURCE_DYNAMIC_LATENCY : 0),
+                           ((value & PA_SINK_LATENCY) ? PA_SOURCE_LATENCY : 0) |
+                           ((value & PA_SINK_DYNAMIC_LATENCY) ? PA_SINK_DYNAMIC_LATENCY : 0));
+}
+
 /* Called from IO context, or before _put() from main context */
 void pa_sink_set_rtpoll(pa_sink *s, pa_rtpoll *p) {
     pa_sink_assert_ref(s);
diff --git a/src/pulsecore/sink.h b/src/pulsecore/sink.h
index 55bca7f..3cd7e59 100644
--- a/src/pulsecore/sink.h
+++ b/src/pulsecore/sink.h
@@ -282,6 +282,8 @@ 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);
 void pa_sink_mute_changed(pa_sink *s, pa_bool_t new_muted);
 
+void pa_sink_update_flags(pa_sink *s, pa_sink_flags_t mask, pa_sink_flags_t value);
+
 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);
 pa_bool_t pa_device_init_intended_roles(pa_proplist *p);
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 8970d8e..46f049e 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -461,7 +461,7 @@ static void source_free(pa_object *o) {
     pa_xfree(s);
 }
 
-/* Called from main context */
+/* Called from main context, and not while the IO thread is active, please */
 void pa_source_set_asyncmsgq(pa_source *s, pa_asyncmsgq *q) {
     pa_source_assert_ref(s);
     pa_assert_ctl_context();
@@ -469,7 +469,21 @@ void pa_source_set_asyncmsgq(pa_source *s, pa_asyncmsgq *q) {
     s->asyncmsgq = q;
 }
 
-/* Called from main context */
+/* Called from main context, and not while the IO thread is active, please */
+void pa_source_update_flags(pa_source *s, pa_source_flags_t mask, pa_source_flags_t value) {
+    pa_source_assert_ref(s);
+    pa_assert_ctl_context();
+
+    if (mask == 0)
+        return;
+
+    /* For now, allow only a minimal set of flags to be changed. */
+    pa_assert((mask & ~(PA_SOURCE_DYNAMIC_LATENCY|PA_SOURCE_LATENCY)) == 0);
+
+    s->flags = (s->flags & ~mask) | (value & mask);
+}
+
+/* Called from IO context, or before _put() from main context */
 void pa_source_set_rtpoll(pa_source *s, pa_rtpoll *p) {
     pa_source_assert_ref(s);
     pa_source_assert_io_context(s);
diff --git a/src/pulsecore/source.h b/src/pulsecore/source.h
index bb085a0..6f33de0 100644
--- a/src/pulsecore/source.h
+++ b/src/pulsecore/source.h
@@ -246,6 +246,8 @@ void pa_source_mute_changed(pa_source *s, pa_bool_t new_muted);
 
 int pa_source_sync_suspend(pa_source *s);
 
+void pa_source_update_flags(pa_source *s, pa_source_flags_t mask, pa_source_flags_t value);
+
 /*** May be called by everyone, from main context */
 
 /* The returned value is supposed to be in the time domain of the sound card! */

commit e5b08a81d23d94c668fdfabc4c6c196e14640869
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Aug 15 03:42:16 2009 +0200

    ladspa/remap: sync latency flags from master sink when moving between sinks

diff --git a/src/modules/module-ladspa-sink.c b/src/modules/module-ladspa-sink.c
index 3c6e349..f2d53d0 100644
--- a/src/modules/module-ladspa-sink.c
+++ b/src/modules/module-ladspa-sink.c
@@ -391,6 +391,7 @@ static void sink_input_moving_cb(pa_sink_input *i, pa_sink *dest) {
     pa_assert_se(u = i->userdata);
 
     pa_sink_set_asyncmsgq(u->sink, dest->asyncmsgq);
+    pa_sink_update_flags(u->sink, PA_SINK_LATENCY|PA_SINK_DYNAMIC_LATENCY, dest->flags);
 }
 
 int pa__init(pa_module*m) {
diff --git a/src/modules/module-remap-sink.c b/src/modules/module-remap-sink.c
index 7b4c9bb..0b4fdc9 100644
--- a/src/modules/module-remap-sink.c
+++ b/src/modules/module-remap-sink.c
@@ -303,6 +303,7 @@ static void sink_input_moving_cb(pa_sink_input *i, pa_sink *dest) {
     pa_assert_se(u = i->userdata);
 
     pa_sink_set_asyncmsgq(u->sink, dest->asyncmsgq);
+    pa_sink_update_flags(u->sink, PA_SINK_LATENCY|PA_SINK_DYNAMIC_LATENCY, dest->flags);
 }
 
 int pa__init(pa_module*m) {

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list