[vlc-commits] aout: no stereo-mode for passthrough

Thomas Guillem git at videolan.org
Wed Jul 19 18:57:44 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jul 18 16:01:39 2017 +0200| [07b2a6c684c09418f17d719fc81787f0607a9a5f] | committer: Thomas Guillem

aout: no stereo-mode for passthrough

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

 src/audio_output/output.c | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/src/audio_output/output.c b/src/audio_output/output.c
index a9afca7e7f..ec9f68996b 100644
--- a/src/audio_output/output.c
+++ b/src/audio_output/output.c
@@ -391,6 +391,9 @@ static void aout_PrepareStereoMode (audio_output_t *aout,
     vlc_value_t val, txt, default_val;
     val.i_int = 0;
 
+    if (!AOUT_FMT_LINEAR(fmt))
+        return;
+
     if (!b_stereo_original)
     {
         val.i_int = AOUT_VAR_CHAN_UNSET;
@@ -474,16 +477,8 @@ int aout_OutputNew (audio_output_t *aout, audio_sample_format_t *restrict fmt,
 {
     aout_OutputAssertLocked (aout);
 
-    int i_forced_stereo_mode = var_GetInteger (aout, "stereo-mode");
-    bool b_stereo_original = fmt->i_physical_channels == AOUT_CHANS_STEREO;
-    if (i_forced_stereo_mode != AOUT_VAR_CHAN_UNSET)
-    {
-        if (i_forced_stereo_mode == AOUT_VAR_CHAN_LEFT
-         || i_forced_stereo_mode == AOUT_VAR_CHAN_RIGHT)
-            fmt->i_physical_channels = AOUT_CHAN_CENTER;
-        else
-            fmt->i_physical_channels = AOUT_CHANS_STEREO;
-    }
+    int i_forced_stereo_mode = AOUT_VAR_CHAN_UNSET;
+    bool b_stereo_original = false;
 
     /* Ideally, the audio filters would be created before the audio output,
      * and the ideal audio format would be the output of the filters chain.
@@ -493,6 +488,17 @@ int aout_OutputNew (audio_output_t *aout, audio_sample_format_t *restrict fmt,
         fmt->i_format = (fmt->i_bitspersample > 16) ? VLC_CODEC_FL32
                                                     : VLC_CODEC_S16N;
 
+        i_forced_stereo_mode = var_GetInteger (aout, "stereo-mode");
+        b_stereo_original = fmt->i_physical_channels == AOUT_CHANS_STEREO;
+        if (i_forced_stereo_mode != AOUT_VAR_CHAN_UNSET)
+        {
+            if (i_forced_stereo_mode == AOUT_VAR_CHAN_LEFT
+             || i_forced_stereo_mode == AOUT_VAR_CHAN_RIGHT)
+                fmt->i_physical_channels = AOUT_CHAN_CENTER;
+            else
+                fmt->i_physical_channels = AOUT_CHANS_STEREO;
+        }
+
         aout_FormatPrepare (fmt);
     }
 



More information about the vlc-commits mailing list