[vlc-commits] aout: accept unknown channels for passthrough

Thomas Guillem git at videolan.org
Thu Jan 25 15:04:24 CET 2018


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jan 22 15:00:45 2018 +0100| [bce67df3969c5a946676da322b9890b5f69d2aa6] | committer: Thomas Guillem

aout: accept unknown channels for passthrough

Fix audio passthrough playback when our demux/packetizer can't parse hd audio
codecs informations.

Aouts don't use channels anymore when configuring passthrough.

(cherry picked from commit 2b07680ad493ce2276404f9ee07916a72750f1c9)
(cherry picked from commit 154687459fb8ae0362970fd3b9e072fbfd2da484)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 src/audio_output/dec.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index f37a6e396b..cf7642ca08 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -45,15 +45,17 @@ int aout_DecNew( audio_output_t *p_aout,
                  const audio_replay_gain_t *p_replay_gain,
                  const aout_request_vout_t *p_request_vout )
 {
-
-    /* Sanitize audio format, input need to have a valid physical channels
-     * layout or a valid number of channels. */
-    int i_map_channels = aout_FormatNbChannels( p_format );
-    if( ( i_map_channels == 0 && p_format->i_channels == 0 )
-       || i_map_channels > AOUT_CHAN_MAX || p_format->i_channels > INPUT_CHAN_MAX )
+    if( p_format->i_bitspersample > 0 )
     {
-        msg_Err( p_aout, "invalid audio channels count" );
-        return -1;
+        /* Sanitize audio format, input need to have a valid physical channels
+         * layout or a valid number of channels. */
+        int i_map_channels = aout_FormatNbChannels( p_format );
+        if( ( i_map_channels == 0 && p_format->i_channels == 0 )
+           || i_map_channels > AOUT_CHAN_MAX || p_format->i_channels > INPUT_CHAN_MAX )
+        {
+            msg_Err( p_aout, "invalid audio channels count" );
+            return -1;
+        }
     }
 
     if( p_format->i_rate > 352800 )



More information about the vlc-commits mailing list