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

Thomas Guillem git at videolan.org
Tue Jan 23 09:53:21 CET 2018


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

aout: accept unknown channels/rate for passthrough

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

Aouts don't use channels/rate anymore when configuring passthrough.

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

 src/audio_output/dec.c | 42 ++++++++++++++++++++++--------------------
 1 file changed, 22 insertions(+), 20 deletions(-)

diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index f37a6e396b..7a5eff67f6 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -45,28 +45,30 @@ 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 )
-    {
-        msg_Err( p_aout, "excessive audio sample frequency (%u)",
-                 p_format->i_rate );
-        return -1;
-    }
-    if( p_format->i_rate < 4000 )
-    {
-        msg_Err( p_aout, "too low audio sample frequency (%u)",
-                 p_format->i_rate );
-        return -1;
+        if( p_format->i_rate > 352800 )
+        {
+            msg_Err( p_aout, "excessive audio sample frequency (%u)",
+                     p_format->i_rate );
+            return -1;
+        }
+        if( p_format->i_rate < 4000 )
+        {
+            msg_Err( p_aout, "too low audio sample frequency (%u)",
+                     p_format->i_rate );
+            return -1;
+        }
     }
 
     aout_owner_t *owner = aout_owner(p_aout);



More information about the vlc-commits mailing list