[pulseaudio-discuss] [PATCH v1 4/4] device-restore: Remove the ability to restore volumes for sinks.

poljar (Damir Jelić) poljarinho at gmail.com
Sun Mar 17 13:48:44 PDT 2013


This change disables volume restoring for sinks that have a port. Sinks
with ports inherit the restored volume from the port.

For sinks without ports nothing is changed.
---
 src/modules/module-device-restore.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/modules/module-device-restore.c b/src/modules/module-device-restore.c
index 8360a05..f5b33c7 100644
--- a/src/modules/module-device-restore.c
+++ b/src/modules/module-device-restore.c
@@ -775,7 +775,7 @@ static pa_hook_result_t sink_fixate_hook_callback(pa_core *c, pa_sink_new_data *
 
     if ((e = perportentry_read(u, name, new_data->active_port))) {
 
-        if (u->restore_volume && e->volume_valid) {
+        if (u->restore_volume && e->volume_valid && !new_data->active_port) {
 
             if (!new_data->volume_is_set) {
                 pa_cvolume v;
@@ -823,7 +823,7 @@ static pa_hook_result_t sink_port_hook_callback(pa_core *c, pa_sink *sink, struc
 
     if ((e = perportentry_read(u, name, (sink->active_port ? sink->active_port->name : NULL)))) {
 
-        if (u->restore_volume && e->volume_valid) {
+        if (u->restore_volume && e->volume_valid && !sink->active_port) {
             pa_cvolume v;
             char buf[PA_CVOLUME_SNPRINT_MAX];
 
-- 
1.8.2



More information about the pulseaudio-discuss mailing list