summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-05-21 22:45:52 +0000
committerLennart Poettering <lennart@poettering.net>2008-05-21 22:45:52 +0000
commit32c53f303a2f0a173fe9fce7417e338b1901cd9f (patch)
treea84949c6598bf03214bfa3a347a921dde8ae934e /src
parent2ed84edbaeed0e5a6085cedaa8c3730774cc6612 (diff)
move volume restore table from runtime to state dir, fix another compiler warning
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2477 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src')
-rw-r--r--src/modules/module-volume-restore.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/module-volume-restore.c b/src/modules/module-volume-restore.c
index 336bcac9..1266c2ab 100644
--- a/src/modules/module-volume-restore.c
+++ b/src/modules/module-volume-restore.c
@@ -102,7 +102,7 @@ static pa_cvolume* parse_volume(const char *s, pa_cvolume *v) {
return NULL;
k = strtol(s, &p, 0);
- if (k <= 0 || k > PA_CHANNELS_MAX)
+ if (k <= 0 || k > (long) PA_CHANNELS_MAX)
return NULL;
v->channels = (unsigned) k;
@@ -488,7 +488,6 @@ int pa__init(pa_module*m) {
u = pa_xnew(struct userdata, 1);
u->core = m->core;
u->hashmap = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
- u->table_file = pa_runtime_path(pa_modargs_get_value(ma, "table", DEFAULT_VOLUME_TABLE_FILE));
u->modified = FALSE;
u->subscription = NULL;
u->sink_input_new_hook_slot = u->sink_input_fixate_hook_slot = u->source_output_new_hook_slot = NULL;
@@ -496,6 +495,9 @@ int pa__init(pa_module*m) {
m->userdata = u;
+ if (!(u->table_file = pa_state_path(pa_modargs_get_value(ma, "table", DEFAULT_VOLUME_TABLE_FILE))))
+ goto fail;
+
if (pa_modargs_get_value_boolean(ma, "restore_device", &restore_device) < 0 ||
pa_modargs_get_value_boolean(ma, "restore_volume", &restore_volume) < 0) {
pa_log("restore_volume= and restore_device= expect boolean arguments");