[pulseaudio-discuss] [PATCH] sink-input, source-output: Fix mute saving

Peter Meerwald pmeerw at pmeerw.net
Mon Apr 14 23:05:15 PDT 2014


Hello Tanu,

some information that describes the bug would be good, such as how to 
trigger, what the observed effect is, what goes wrong

the fix is not obvious (to me at least)

the negated condition, i->muted == mute, looks a bit weird

thanks, p.

> ---
>  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 fb2a893..e1aae51 100644
> --- a/src/pulsecore/sink-input.c
> +++ b/src/pulsecore/sink-input.c
> @@ -1415,7 +1415,7 @@ void pa_sink_input_set_mute(pa_sink_input *i, bool mute, bool save) {
>      pa_assert(PA_SINK_INPUT_IS_LINKED(i->state));
>  
>      if (!i->muted == !mute) {
> -        i->save_muted = i->save_muted || mute;
> +        i->save_muted |= save;
>          return;
>      }
>  
> diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
> index 4e4b7e9..b12758a 100644
> --- a/src/pulsecore/source-output.c
> +++ b/src/pulsecore/source-output.c
> @@ -1062,7 +1062,7 @@ void pa_source_output_set_mute(pa_source_output *o, bool mute, bool save) {
>      pa_assert(PA_SOURCE_OUTPUT_IS_LINKED(o->state));
>  
>      if (!o->muted == !mute) {
> -        o->save_muted = o->save_muted || mute;
> +        o->save_muted |= save;
>          return;
>      }
>  
> 

-- 

Peter Meerwald
+43-664-2444418 (mobile)


More information about the pulseaudio-discuss mailing list