]> code.delx.au - pulseaudio/blobdiff - src/modules/module-volume-restore.c
move flat volume logic into the core. while doing so add n_volume_steps field to...
[pulseaudio] / src / modules / module-volume-restore.c
index 0fb17a0d7b774a0dee74727f6fe49eba4c654dbf..e32552c3c5590e968bcde32d293f6a85c32d7727 100644 (file)
@@ -103,7 +103,7 @@ static pa_cvolume* parse_volume(const char *s, pa_cvolume *v) {
     if (k <= 0 || k > (long) PA_CHANNELS_MAX)
         return NULL;
 
-    v->channels = (unsigned) k;
+    v->channels = (uint8_t) k;
 
     for (i = 0; i < v->channels; i++) {
         p += strspn(p, WHITESPACE);
@@ -417,7 +417,7 @@ static pa_hook_result_t sink_input_new_hook_callback(pa_core *c, pa_sink_input_n
 
     if ((r = pa_hashmap_get(u->hashmap, name))) {
         if (!data->sink && r->sink) {
-            if ((data->sink = pa_namereg_get(c, r->sink, PA_NAMEREG_SINK, 1)))
+            if ((data->sink = pa_namereg_get(c, r->sink, PA_NAMEREG_SINK)))
                 pa_log_info("Restoring sink for <%s>", r->name);
         }
     }
@@ -443,7 +443,7 @@ static pa_hook_result_t sink_input_fixate_hook_callback(pa_core *c, pa_sink_inpu
 
         if (r->volume_is_set && data->sample_spec.channels == r->volume.channels) {
             pa_log_info("Restoring volume for <%s>", r->name);
-            pa_sink_input_new_data_set_volume(data, &r->volume);
+            pa_sink_input_new_data_set_virtual_volume(data, &r->volume);
         }
     }
 
@@ -463,7 +463,7 @@ static pa_hook_result_t source_output_new_hook_callback(pa_core *c, pa_source_ou
 
     if ((r = pa_hashmap_get(u->hashmap, name))) {
         if (!data->source && r->source) {
-            if ((data->source = pa_namereg_get(c, r->source, PA_NAMEREG_SOURCE, 1)))
+            if ((data->source = pa_namereg_get(c, r->source, PA_NAMEREG_SOURCE)))
                 pa_log_info("Restoring source for <%s>", r->name);
         }
     }