[vlc-devel] [PATCH] opensles_android: report mute state

Alexandre Janniaux ajanni at videolabs.io
Sat Jan 30 11:32:45 UTC 2021


Hi,

LGTM,

Regarding style, I would have written it like an early return,
but that's personal style so is not important.

     SLresult r = SetMute(sys->volumeItf, mute);
-    return (r == SL_RESULT_SUCCESS) ? 0 : -1;
+    if (r != SL_RESULT_SUCCESS)
+        return -1;
+
+    aout_MuteReport(aout, mute);
+    return 0;
 }

Regards,
--
Alexandre Janniaux
Videolabs

On Sat, Jan 30, 2021 at 05:52:38PM +0800, Zhao Zhili wrote:
> ---
>  modules/audio_output/opensles_android.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/modules/audio_output/opensles_android.c b/modules/audio_output/opensles_android.c
> index 9e90b393d5..5459c40f04 100644
> --- a/modules/audio_output/opensles_android.c
> +++ b/modules/audio_output/opensles_android.c
> @@ -224,7 +224,12 @@ static int MuteSet(audio_output_t *aout, bool mute)
>          return -1;
>
>      SLresult r = SetMute(sys->volumeItf, mute);
> -    return (r == SL_RESULT_SUCCESS) ? 0 : -1;
> +    if (r == SL_RESULT_SUCCESS) {
> +        aout_MuteReport(aout, mute);
> +        return 0;
> +    } else {
> +        return -1;
> +    }
>  }
>
>  static void Pause(audio_output_t *aout, bool pause, vlc_tick_t date)
> --
> 2.28.0
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list