]> git.sesse.net Git - vlc/blobdiff - src/audio_output/dec.c
tremor: can't generate thumb code because of inline asm
[vlc] / src / audio_output / dec.c
index a3fe900e808e786f1f469ea060d1c134eb006269..4ebfcf0675ac0ed5532f85bcb2dd41abfc301666 100644 (file)
@@ -42,7 +42,7 @@
 /*****************************************************************************
  * aout_DecNew : create a decoder
  *****************************************************************************/
-static aout_input_t * DecNew( vlc_object_t * p_this, aout_instance_t * p_aout,
+static aout_input_t * DecNew( aout_instance_t * p_aout,
                               audio_sample_format_t *p_format,
                               const audio_replay_gain_t *p_replay_gain,
                               const aout_request_vout_t *p_request_vout )
@@ -61,6 +61,11 @@ static aout_input_t * DecNew( vlc_object_t * p_this, aout_instance_t * p_aout,
         msg_Err( p_aout, "no audio channels" );
         return NULL;
     }
+    if( p_format->i_channels != aout_FormatNbChannels( p_format ) )
+    {
+        msg_Err( p_aout, "incompatible audio channels count with layout mask" );
+        return NULL;
+    }
 
     if( p_format->i_rate > 192000 )
     {
@@ -107,7 +112,7 @@ static aout_input_t * DecNew( vlc_object_t * p_this, aout_instance_t * p_aout,
     p_aout->pp_inputs[p_aout->i_nb_inputs] = p_input;
     p_aout->i_nb_inputs++;
 
-    if ( p_aout->mixer.b_error )
+    if ( !p_aout->p_mixer )
     {
         int i;
 
@@ -183,7 +188,7 @@ aout_input_t * __aout_DecNew( vlc_object_t * p_this,
         *pp_aout = p_aout;
     }
 
-    return DecNew( p_this, p_aout, p_format, p_replay_gain, p_request_video );
+    return DecNew( p_aout, p_format, p_replay_gain, p_request_video );
 }
 
 /*****************************************************************************
@@ -226,14 +231,8 @@ int aout_DecDelete( aout_instance_t * p_aout, aout_input_t * p_input )
     {
         aout_OutputDelete( p_aout );
         aout_MixerDelete( p_aout );
-        if ( var_Type( p_aout, "audio-device" ) != 0 )
-        {
-            var_Destroy( p_aout, "audio-device" );
-        }
-        if ( var_Type( p_aout, "audio-channels" ) != 0 )
-        {
-            var_Destroy( p_aout, "audio-channels" );
-        }
+        var_Destroy( p_aout, "audio-device" );
+        var_Destroy( p_aout, "audio-channels" );
     }
 
     aout_unlock_mixer( p_aout );
@@ -380,7 +379,7 @@ void aout_DecChangePause( aout_instance_t *p_aout, aout_input_t *p_input, bool b
     if( i_duration != 0 )
     {
         aout_lock_mixer( p_aout );
-        for( aout_buffer_t *p = p_input->fifo.p_first; p != NULL; p = p->p_next )
+        for( aout_buffer_t *p = p_input->mixer.fifo.p_first; p != NULL; p = p->p_next )
         {
             p->start_date += i_duration;
             p->end_date += i_duration;
@@ -393,8 +392,8 @@ void aout_DecFlush( aout_instance_t *p_aout, aout_input_t *p_input )
 {
     aout_lock_input_fifos( p_aout );
 
-    aout_FifoSet( p_aout, &p_input->fifo, 0 );
-    p_input->p_first_byte_to_mix = NULL;
+    aout_FifoSet( p_aout, &p_input->mixer.fifo, 0 );
+    p_input->mixer.begin = NULL;
 
     aout_unlock_input_fifos( p_aout );
 }