[vlc-commits] pulse: fix passthrough without channel layout

Thomas Guillem git at videolan.org
Fri Oct 14 12:59:27 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Oct 14 10:54:52 2016 +0200| [2bb710c350b1e2ba894483d45850c5054109e506] | committer: Thomas Guillem

pulse: fix passthrough without channel layout

In case or linear format, fmt->i_channels is always set to
aout_FormatNbChannels(fmt) before aout->start().

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

 modules/audio_output/pulse.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index ffe9ada..38a0d66 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -698,9 +698,6 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
     struct pa_sample_spec ss;
     pa_encoding_t encoding = PA_ENCODING_INVALID;
 
-    if (aout_FormatNbChannels(fmt) == 0)
-        return VLC_EGENERIC;
-
     switch (fmt->i_format)
     {
         case VLC_CODEC_FL64:
@@ -742,11 +739,11 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
             fmt->i_frame_length = 1;
             encoding = PA_ENCODING_DTS_IEC61937;
             ss.format = PA_SAMPLE_S16NE;
-
             break;
         default:
-            if (!AOUT_FMT_LINEAR(fmt))
+            if (!AOUT_FMT_LINEAR(fmt) || aout_FormatNbChannels(fmt) == 0)
                 return VLC_EGENERIC;
+
             if (HAVE_FPU)
             {
                 fmt->i_format = VLC_CODEC_FL32;
@@ -761,7 +758,7 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
     }
 
     ss.rate = fmt->i_rate;
-    ss.channels = aout_FormatNbChannels(fmt);
+    ss.channels = fmt->i_channels;
     if (!pa_sample_spec_valid(&ss)) {
         msg_Err(aout, "unsupported sample specification");
         return VLC_EGENERIC;



More information about the vlc-commits mailing list