[pulseaudio-discuss] [PATCH] sink-input, source-output: Don't remap volume for passthrough streams

Arun Raghavan arun at arunraghavan.net
Sun May 20 06:05:02 UTC 2018


This fixes an assert when we try to restore the original volume map on
the synthesized (100%) volume of a passthrough stream.
---
 src/pulsecore/sink-input.c    | 2 +-
 src/pulsecore/source-output.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 5a55e93a5..ebe5cc957 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -403,7 +403,7 @@ int pa_sink_input_new(
     if (!data->volume_writable)
         data->save_volume = false;
 
-    if (data->volume_is_set)
+    if (data->volume_is_set && !pa_sink_input_new_data_is_passthrough(data))
         /* The original volume channel map may be different than the final
          * stream channel map, so remapping may be needed. */
         pa_cvolume_remap(&data->volume, &volume_map, &data->channel_map);
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index bcef51fdb..17f5da5e1 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -341,7 +341,7 @@ int pa_source_output_new(
     if (!data->volume_writable)
         data->save_volume = false;
 
-    if (data->volume_is_set)
+    if (data->volume_is_set && !pa_source_output_new_data_is_passthrough(data))
         /* The original volume channel map may be different than the final
          * stream channel map, so remapping may be needed. */
         pa_cvolume_remap(&data->volume, &volume_map, &data->channel_map);
-- 
2.17.0



More information about the pulseaudio-discuss mailing list