]> git.sesse.net Git - vlc/blobdiff - src/audio_output/common.c
use var_Get(Bool|Integer|...) when possible.
[vlc] / src / audio_output / common.c
index fba6665557e68d88aa2454b2b890c2a6775b7893..771419d461dc0b128775ed96ad543e63265468da 100644 (file)
@@ -33,6 +33,7 @@
 #include <vlc_common.h>
 #include <vlc_aout.h>
 #include "aout_internal.h"
+#include "libvlc.h"
 
 /*
  * Instances management (internal and external)
@@ -58,6 +59,9 @@ static inline void aout_assert_fifo_locked( aout_instance_t * p_aout, aout_fifo_
         if( i == p_aout->i_nb_inputs )
             vlc_assert_locked( &p_aout->mixer_lock );
     }
+#else
+    (void)p_aout;
+    (void)p_fifo;
 #endif
 }
 
@@ -156,6 +160,8 @@ unsigned int aout_BitsPerSample( vlc_fourcc_t i_format )
     case VLC_FOURCC('s','2','4','b'):
         return 24;
 
+    case VLC_FOURCC('s','3','2','l'):
+    case VLC_FOURCC('s','3','2','b'):
     case VLC_FOURCC('f','l','3','2'):
     case VLC_FOURCC('f','i','3','2'):
         return 32;
@@ -509,7 +515,8 @@ mtime_t aout_DateGet( const audio_date_t * p_date )
  *****************************************************************************/
 mtime_t aout_DateIncrement( audio_date_t * p_date, uint32_t i_nb_samples )
 {
-    mtime_t i_dividend = (mtime_t)i_nb_samples * 1000000;
+    mtime_t i_dividend = INT64_C(1000000) * i_nb_samples;
+    assert( p_date->i_divider > 0 ); /* uninitialized audio_data_t ? */
     p_date->date += i_dividend / p_date->i_divider;
     p_date->i_remainder += (int)(i_dividend % p_date->i_divider);
     if ( p_date->i_remainder >= p_date->i_divider )
@@ -532,7 +539,13 @@ int aout_CheckChannelReorder( const uint32_t *pi_chan_order_in,
     bool b_chan_reorder = false;
     int i, j, k, l;
 
-    if( i_channels > AOUT_CHAN_MAX ) return false;
+    if( i_channels > AOUT_CHAN_MAX )
+        return false;
+
+    if( pi_chan_order_in == NULL )
+        pi_chan_order_in = pi_vlc_chan_order_wg4;
+    if( pi_chan_order_out == NULL )
+        pi_chan_order_out = pi_vlc_chan_order_wg4;
 
     for( i = 0, j = 0; pi_chan_order_in[i]; i++ )
     {