[vlc-commits] alsa: reorder code

Rémi Denis-Courmont git at videolan.org
Sun Apr 15 15:40:21 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Apr  8 13:33:43 2018 +0300| [ead2b1129712fc6884ac5f34e7862dfd0a3f6457] | committer: Rémi Denis-Courmont

alsa: reorder code

No functional changes.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ead2b1129712fc6884ac5f34e7862dfd0a3f6457
---

 modules/audio_output/alsa.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c
index c4a2207926..57c4e9641b 100644
--- a/modules/audio_output/alsa.c
+++ b/modules/audio_output/alsa.c
@@ -300,6 +300,7 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
 {
     aout_sys_t *sys = aout->sys;
     snd_pcm_format_t pcm_format; /* ALSA sample format */
+    unsigned channels;
     int passthrough = PASSTHROUGH_NONE;
 
     if (aout_FormatNbChannels(fmt) == 0)
@@ -324,7 +325,10 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
             break;
         default:
             if (AOUT_FMT_SPDIF(fmt))
+            {
                 passthrough = var_InheritInteger(aout, "alsa-passthrough");
+                channels = 2;
+            }
 
             if (passthrough != PASSTHROUGH_NONE)
             {
@@ -477,7 +481,6 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
     }
 
     /* Set channels count */
-    unsigned channels;
     if (passthrough == PASSTHROUGH_NONE)
     {
         uint16_t map = var_InheritInteger (aout, "alsa-audio-channels");
@@ -488,10 +491,7 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
         channels = vlc_popcount (map);
     }
     else
-    {
         sys->chans_to_reorder = 0;
-        channels = 2;
-    }
 
     /* By default, ALSA plug will pad missing channels with zeroes, which is
      * usually fine. However, it will also discard extraneous channels, which



More information about the vlc-commits mailing list