]> git.sesse.net Git - vlc/blobdiff - modules/audio_output/portaudio.c
vlc_cond_init: really remove useless parameter
[vlc] / modules / audio_output / portaudio.c
index 0c19f297cb90b03756617b259d5db175d6ba23f2..74afad6048485257111dafe8cd9c3bb7733267e9 100644 (file)
@@ -77,21 +77,16 @@ struct aout_sys_t
     uint32_t i_channels;
 };
 
-static const uint32_t pi_channels_in[] =
-    { AOUT_CHAN_LEFT, AOUT_CHAN_RIGHT,
-      AOUT_CHAN_MIDDLELEFT, AOUT_CHAN_MIDDLERIGHT,
-      AOUT_CHAN_REARLEFT, AOUT_CHAN_REARRIGHT,
-      AOUT_CHAN_CENTER, AOUT_CHAN_LFE, 0 };
 static const uint32_t pi_channels_out[] =
     { AOUT_CHAN_LEFT, AOUT_CHAN_RIGHT,
       AOUT_CHAN_CENTER, AOUT_CHAN_LFE,
-      AOUT_CHAN_REARLEFT, AOUT_CHAN_REARRIGHT,
+      AOUT_CHAN_REARLEFT, AOUT_CHAN_REARRIGHT, AOUT_CHAN_REARCENTER,
       AOUT_CHAN_MIDDLELEFT, AOUT_CHAN_MIDDLERIGHT, 0 };
 
 #ifdef PORTAUDIO_IS_SERIOUSLY_BROKEN
 static bool b_init = 0;
 static pa_thread_t *pa_thread;
-static void PORTAUDIOThread( pa_thread_t * );
+static void* PORTAUDIOThread( vlc_object_t * );
 #endif
 
 /*****************************************************************************
@@ -216,10 +211,10 @@ static int Open( vlc_object_t * p_this )
         pa_thread->p_aout = p_aout;
         pa_thread->b_error = false;
         vlc_mutex_init( &pa_thread->lock_wait );
-        vlc_cond_init( p_aout, &pa_thread->wait );
+        vlc_cond_init( &pa_thread->wait );
         pa_thread->b_wait = false;
         vlc_mutex_init( &pa_thread->lock_signal );
-        vlc_cond_init( p_aout, &pa_thread->signal );
+        vlc_cond_init( &pa_thread->signal );
         pa_thread->b_signal = false;
 
         /* Create PORTAUDIOThread */
@@ -515,7 +510,7 @@ static int PAOpenStream( aout_instance_t *p_aout )
     p_aout->output.p_sys->i_channels = i_channels;
 
     p_aout->output.p_sys->b_chan_reorder =
-        aout_CheckChannelReorder( pi_channels_in, pi_channels_out,
+        aout_CheckChannelReorder( NULL, pi_channels_out,
                                   i_channel_mask, i_channels,
                                   p_aout->output.p_sys->pi_chan_table );
 
@@ -572,11 +567,13 @@ static void Play( aout_instance_t * p_aout )
  * PORTAUDIOThread: all interactions with libportaudio.a are handled
  * in this single thread.  Otherwise libportaudio.a is _not_ happy :-(
  *****************************************************************************/
-static void PORTAUDIOThread( pa_thread_t *pa_thread )
+static void* PORTAUDIOThread( vlc_object_t *p_this )
 {
+    pa_thread_t *pa_thread = (pa_thread_t*)p_this;
     aout_instance_t *p_aout;
     aout_sys_t *p_sys;
     int i_err;
+    int canc = vlc_savecancel ();
 
     while( vlc_object_alive (pa_thread) )
     {
@@ -649,5 +646,7 @@ static void PORTAUDIOThread( pa_thread_t *pa_thread )
         vlc_cond_signal( &pa_thread->wait );
         vlc_mutex_unlock( &pa_thread->lock_wait );
     }
+    vlc_restorecancel (canc);
+    return NULL;
 }
 #endif