[pulseaudio-discuss] [PATCH] sink-input/source-output: Don't set save_volume if volume is not writable

David Henningsson david.henningsson at canonical.com
Wed May 15 05:28:15 PDT 2013


This fixes a later assertion failure in module-stream-restore.

Buglink: https://bugs.launchpad.net/bugs/896602
Signed-off-by: David Henningsson <david.henningsson at canonical.com>
---
 src/pulsecore/sink-input.c    |    3 +++
 src/pulsecore/source-output.c |    3 +++
 2 files changed, 6 insertions(+)

diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 6131bd3..8b9ee72 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -376,6 +376,9 @@ int pa_sink_input_new(
         data->save_volume = FALSE;
     }
 
+    if (!data->volume_writable)
+        data->save_volume = false;
+
     pa_return_val_if_fail(pa_cvolume_compatible(&data->volume, &data->sample_spec), -PA_ERR_INVALID);
 
     if (!data->muted_is_set)
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index d942419..96245c7 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -309,6 +309,9 @@ int pa_source_output_new(
         data->save_volume = FALSE;
     }
 
+    if (!data->volume_writable)
+        data->save_volume = false;
+
     pa_return_val_if_fail(pa_cvolume_compatible(&data->volume, &data->sample_spec), -PA_ERR_INVALID);
 
     if (!data->volume_factor_is_set)
-- 
1.7.9.5



More information about the pulseaudio-discuss mailing list