[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.19-348-gcd55955

Colin Guthrie gitmailer-noreply at 0pointer.de
Tue Feb 9 15:18:53 PST 2010


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  2f86ba4fc22901b4aa5e0b4029d3b80f3feb0a91 (commit)

- Log -----------------------------------------------------------------
cd55955 core: Fix macro typo - PA_SINK_IS_LINKED -> PA_SINK_INPUT_IS_LINKED
6fd2d08 stream-restore: Clear the save_sink/save_source flags on apply_entry.
-----------------------------------------------------------------------

Summary of changes:
 src/modules/module-stream-restore.c |   48 ++++++++++++++++++++++++++--------
 src/pulsecore/sink-input.c          |    2 +-
 2 files changed, 37 insertions(+), 13 deletions(-)

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

commit 6fd2d087585b33dce918e857e9f2635862a0746c
Author: Colin Guthrie <cguthrie at mandriva.org>
Date:   Fri Feb 5 00:15:38 2010 +0000

    stream-restore: Clear the save_sink/save_source flags on apply_entry.
    
    If the user specifically removes the device element from the stream
    restore rule, we have to clear the save_sink/save_source flag of the
    stream. This means that other stream routing systems
    (e.g. module-device-manager) can take over routing for this
    stream. In order to facilitate the reapplication of other routing
    rules, we fire a stream change event. Arguably the stream itself
    has not changed, but the rules governing its routing have, so
    I feel this is justified.

diff --git a/src/modules/module-stream-restore.c b/src/modules/module-stream-restore.c
index becdb54..64a7fd3 100644
--- a/src/modules/module-stream-restore.c
+++ b/src/modules/module-stream-restore.c
@@ -1626,12 +1626,24 @@ static void apply_entry(struct userdata *u, const char *name, struct entry *e) {
             pa_sink_input_set_mute(si, e->muted, TRUE);
         }
 
-        if (u->restore_device &&
-            e->device_valid &&
-            (s = pa_namereg_get(u->core, e->device, PA_NAMEREG_SINK))) {
-
-            pa_log_info("Restoring device for stream %s.", name);
-            pa_sink_input_move_to(si, s, TRUE);
+        if (u->restore_device) {
+            if (!e->device_valid) {
+                if (si->save_sink) {
+                    pa_log_info("Ensuring device is not saved for stream %s.", name);
+                    /* If the device is not valid we should make sure the
+                       save flag is cleared as the user may have specifically
+                       removed the sink element from the rule. */
+                    si->save_sink = FALSE;
+                    /* This is cheating a bit. The sink input itself has not changed
+                       but the rules governing it's routing have, so we fire this event
+                       such that other routing modules (e.g. module-device-manager)
+                       will pick up the change and reapply their routing */
+                    pa_subscription_post(si->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE, si->index);
+                }
+            } else if ((s = pa_namereg_get(u->core, e->device, PA_NAMEREG_SINK))) {
+                pa_log_info("Restoring device for stream %s.", name);
+                pa_sink_input_move_to(si, s, TRUE);
+            }
         }
     }
 
@@ -1648,12 +1660,24 @@ static void apply_entry(struct userdata *u, const char *name, struct entry *e) {
         }
         pa_xfree(n);
 
-        if (u->restore_device &&
-            e->device_valid &&
-            (s = pa_namereg_get(u->core, e->device, PA_NAMEREG_SOURCE))) {
-
-            pa_log_info("Restoring device for stream %s.", name);
-            pa_source_output_move_to(so, s, TRUE);
+        if (u->restore_device) {
+            if (!e->device_valid) {
+                if (so->save_source) {
+                    pa_log_info("Ensuring device is not saved for stream %s.", name);
+                    /* If the device is not valid we should make sure the
+                       save flag is cleared as the user may have specifically
+                       removed the source element from the rule. */
+                    so->save_source = FALSE;
+                    /* This is cheating a bit. The source output itself has not changed
+                       but the rules governing it's routing have, so we fire this event
+                       such that other routing modules (e.g. module-device-manager)
+                       will pick up the change and reapply their routing */
+                    pa_subscription_post(so->core, PA_SUBSCRIPTION_EVENT_SOURCE_OUTPUT|PA_SUBSCRIPTION_EVENT_CHANGE, so->index);
+                }
+            } else if ((s = pa_namereg_get(u->core, e->device, PA_NAMEREG_SOURCE))) {
+                pa_log_info("Restoring device for stream %s.", name);
+                pa_source_output_move_to(so, s, TRUE);
+            }
         }
     }
 }

commit cd559553a0bfbf37d18c86ba4efc56d65af2ed4e
Author: Colin Guthrie <cguthrie at mandriva.org>
Date:   Tue Feb 9 21:37:32 2010 +0000

    core: Fix macro typo - PA_SINK_IS_LINKED -> PA_SINK_INPUT_IS_LINKED

diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index c75d417..e73999d 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -1061,7 +1061,7 @@ void pa_sink_input_update_proplist(pa_sink_input *i, pa_update_mode_t mode, pa_p
     if (p)
         pa_proplist_update(i->proplist, mode, p);
 
-    if (PA_SINK_IS_LINKED(i->state)) {
+    if (PA_SINK_INPUT_IS_LINKED(i->state)) {
         pa_hook_fire(&i->core->hooks[PA_CORE_HOOK_SINK_INPUT_PROPLIST_CHANGED], i);
         pa_subscription_post(i->core, PA_SUBSCRIPTION_EVENT_SINK_INPUT|PA_SUBSCRIPTION_EVENT_CHANGE, i->index);
     }

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list