mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04:00
volume-restore: forward module load return value of stream-restore back to caller
This commit is contained in:
parent
c117febbe4
commit
d27e26dca0
1 changed files with 6 additions and 3 deletions
|
|
@ -48,6 +48,7 @@ static const char* const valid_modargs[] = {
|
|||
int pa__init(pa_module*m) {
|
||||
pa_modargs *ma = NULL;
|
||||
pa_bool_t restore_device = TRUE, restore_volume = TRUE;
|
||||
pa_module *n;
|
||||
char *t;
|
||||
|
||||
pa_assert(m);
|
||||
|
|
@ -66,13 +67,15 @@ int pa__init(pa_module*m) {
|
|||
pa_log_warn("We will now load module-stream-restore. Please make sure to remove module-volume-restore from your configuration.");
|
||||
|
||||
t = pa_sprintf_malloc("restore_volume=%s restore_device=%s", pa_yes_no(restore_volume), pa_yes_no(restore_device));
|
||||
pa_module_load(m->core, "module-stream-restore", t);
|
||||
n = pa_module_load(m->core, "module-stream-restore", t);
|
||||
pa_xfree(t);
|
||||
|
||||
pa_module_unload_request(m, TRUE);
|
||||
if (n)
|
||||
pa_module_unload_request(m, TRUE);
|
||||
|
||||
pa_modargs_free(ma);
|
||||
return 0;
|
||||
|
||||
return n ? 0 : -1;
|
||||
|
||||
fail:
|
||||
if (ma)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue