]> git.sesse.net Git - vlc/commitdiff
Use the right declaration for threaded functions.
authorRémi Duraffort <ivoire@videolan.org>
Mon, 11 Aug 2008 18:46:04 +0000 (20:46 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Mon, 11 Aug 2008 19:40:32 +0000 (21:40 +0200)
14 files changed:
modules/access_output/bonjour.c
modules/access_output/rtmp.c
modules/access_output/udp.c
modules/audio_output/alsa.c
modules/audio_output/directx.c
modules/audio_output/hd1000a.cpp
modules/audio_output/oss.c
modules/audio_output/portaudio.c
modules/audio_output/waveout.c
modules/codec/avcodec/encoder.c
modules/gui/qnx/aout.c
modules/gui/wince/wince.cpp
modules/gui/wxwidgets/wxwidgets.cpp
modules/video_filter/remoteosd.c

index 37814deb0d454ee9277a0bdef3ed4e933bd10b2f..6b472b4ccf4afad044ea0eb3761078b2ec241bd4 100644 (file)
@@ -181,13 +181,16 @@ static void client_callback( AvahiClient *c,
 /*****************************************************************************
  * poll_iterate_thread
  *****************************************************************************/
-static void poll_iterate_thread( poll_thread_t *p_pt )
+static void* poll_iterate_thread( vlc_object_t *p_this )
 {
+    poll_thread_t *p_pt = (poll_thread_t*)p_this;
     vlc_thread_ready( p_pt );
 
     while( vlc_object_alive (p_pt) )
         if( avahi_simple_poll_iterate( p_pt->simple_poll, 100 ) != 0 )
             break;
+
+    return NULL;
 }
 
 /*****************************************************************************
index a26690a097cfdb9f7973ba8cf4cb02556b870e5b..ebf7175ab6cf486e37fd3ab4014cde306387b35d 100644 (file)
@@ -68,7 +68,7 @@ vlc_module_end();
  *****************************************************************************/
 static ssize_t Write( sout_access_out_t *, block_t * );
 static int     Seek ( sout_access_out_t *, off_t  );
-static void ThreadControl( vlc_object_t * );
+static void* ThreadControl( vlc_object_t * );
 
 struct sout_access_out_sys_t
 {
@@ -379,7 +379,7 @@ static int Seek( sout_access_out_t *p_access, off_t i_pos )
 /*****************************************************************************
  * ThreadControl: manage control messages and pipe media to Read
  *****************************************************************************/
-static void ThreadControl( vlc_object_t *p_this )
+static void* ThreadControl( vlc_object_t *p_this )
 {
     rtmp_control_thread_t *p_thread = (rtmp_control_thread_t *) p_this;
     rtmp_packet_t *rtmp_packet;
@@ -416,4 +416,5 @@ static void ThreadControl( vlc_object_t *p_this )
             p_thread->b_die = 1;
         }
     }
+    return NULL;
 }
index 14da8aa41641c5bab890bbdb7651e03d2421df08..2cadddf90bbf178a0362174671d64083553164cd 100644 (file)
@@ -114,7 +114,7 @@ static const char *const ppsz_core_options[] = {
 static ssize_t Write   ( sout_access_out_t *, block_t * );
 static int  Seek    ( sout_access_out_t *, off_t  );
 
-static void ThreadWrite( vlc_object_t * );
+static void* ThreadWrite( vlc_object_t * );
 static block_t *NewUDPPacket( sout_access_out_t *, mtime_t );
 
 typedef struct sout_access_thread_t
@@ -437,7 +437,7 @@ static block_t *NewUDPPacket( sout_access_out_t *p_access, mtime_t i_dts)
 /*****************************************************************************
  * ThreadWrite: Write a packet on the network at the good time.
  *****************************************************************************/
-static void ThreadWrite( vlc_object_t *p_this )
+static void* ThreadWrite( vlc_object_t *p_this )
 {
     sout_access_thread_t *p_thread = (sout_access_thread_t*)p_this;
     mtime_t              i_date_last = -1;
@@ -519,4 +519,5 @@ static void ThreadWrite( vlc_object_t *p_this )
 
         i_date_last = i_date;
     }
+    return NULL;
 }
index e16a05f78543c0b3397431cfe6be22ec4db28e57..325fa5f733736c572be256a4f37655d853c6aacc 100644 (file)
@@ -90,11 +90,11 @@ struct aout_sys_t
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-static int  Open         ( vlc_object_t * );
-static void Close        ( vlc_object_t * );
-static void Play         ( aout_instance_t * );
-static int  ALSAThread   ( aout_instance_t * );
-static void ALSAFill     ( aout_instance_t * );
+static int   Open         ( vlc_object_t * );
+static void  Close        ( vlc_object_t * );
+static void  Play         ( aout_instance_t * );
+static void* ALSAThread   ( vlc_object_t * );
+static void  ALSAFill     ( aout_instance_t * );
 static int FindDevicesCallback( vlc_object_t *p_this, char const *psz_name,
                                 vlc_value_t newval, vlc_value_t oldval, void *p_unused );
 
@@ -760,8 +760,9 @@ static void Close( vlc_object_t *p_this )
 /*****************************************************************************
  * ALSAThread: asynchronous thread used to DMA the data to the device
  *****************************************************************************/
-static int ALSAThread( aout_instance_t * p_aout )
+static void* ALSAThread( vlc_object_t* p_this )
 {
+    aout_instance_t * p_aout = (aout_instance_t*)p_this;
     struct aout_sys_t * p_sys = p_aout->output.p_sys;
     p_sys->p_status = (snd_pcm_status_t *)malloc(snd_pcm_status_sizeof());
 
@@ -784,7 +785,7 @@ static int ALSAThread( aout_instance_t * p_aout )
 cleanup:
     snd_pcm_drop( p_sys->p_snd_pcm );
     free( p_aout->output.p_sys->p_status );
-    return 0;
+    return NULL;
 }
 
 /*****************************************************************************
index 6c7228e7dc1ae657d98e1b8c5bdac2532146a685..ff4f312d2252e7c74f8e5981580d1771049fddd3 100644 (file)
@@ -210,7 +210,7 @@ static int  InitDirectSound   ( aout_instance_t * );
 static int  CreateDSBuffer    ( aout_instance_t *, int, int, int, int, int, bool );
 static int  CreateDSBufferPCM ( aout_instance_t *, int*, int, int, int, bool );
 static void DestroyDSBuffer   ( aout_instance_t * );
-static void DirectSoundThread ( notification_thread_t * );
+static void* DirectSoundThread( vlc_object_t * );
 static int  FillBuffer        ( aout_instance_t *, int, aout_buffer_t * );
 
 /*****************************************************************************
@@ -1045,8 +1045,9 @@ static int FillBuffer( aout_instance_t *p_aout, int i_frame,
  * We use this thread to emulate a callback mechanism. The thread probes for
  * event notification and fills up the DS secondary buffer when needed.
  *****************************************************************************/
-static void DirectSoundThread( notification_thread_t *p_notif )
+static void* DirectSoundThread( vlc_object_t *p_this )
 {
+    notification_thread_t *p_notif = (notification_thread_t*)p_this;
     aout_instance_t *p_aout = p_notif->p_aout;
     bool b_sleek;
     mtime_t last_time;
@@ -1147,4 +1148,5 @@ static void DirectSoundThread( notification_thread_t *p_notif )
     CloseHandle( p_notif->event );
 
     msg_Dbg( p_notif, "DirectSoundThread exiting" );
+    return NULL;
 }
index 57c5bc2a1f0e27e2acb4583e89bea10330e2f439..3604c6ea017394289044a28e04e5e52ae7062d67 100644 (file)
@@ -67,7 +67,7 @@ static int     Open        ( vlc_object_t * );
 static void    Close       ( vlc_object_t * );
 
 static void    Play        ( aout_instance_t * );
-static int     Thread      ( aout_instance_t * );
+static void*   Thread      ( vlc_object_t * );
 
 static void    InterleaveS16( int16_t *, int16_t * );
 
@@ -216,8 +216,9 @@ static void Play( aout_instance_t * p_aout )
 /*****************************************************************************
  * Thread: thread used to DMA the data to the device
  *****************************************************************************/
-static int Thread( aout_instance_t * p_aout )
+static void* Thread( vlc_object_t *p_this )
 {
+    aout_instance_t * p_aout = (aout_instance_t*)p_this;
     aout_buffer_t * p_buffer;
     struct aout_sys_t * p_sys = p_aout->output.p_sys;
     PCMAudioPlayer * pPlayer = p_sys->pPlayer;
@@ -253,7 +254,7 @@ static int Thread( aout_instance_t * p_aout )
 #undef i
     }
 
-    return VLC_SUCCESS;
+    return NULL;
 }
 
 /*****************************************************************************
index 929aeacb7e6faacd16f17f787bf5fa0c2d626c49..0f1377ea7b4c6a28428a74ba9024a0a633d98e8f 100644 (file)
@@ -93,7 +93,7 @@ static int  Open         ( vlc_object_t * );
 static void Close        ( vlc_object_t * );
 
 static void Play         ( aout_instance_t * );
-static int  OSSThread    ( aout_instance_t * );
+static void* OSSThread   ( vlc_object_t * );
 
 static mtime_t BufferDuration( aout_instance_t * p_aout );
 
@@ -585,8 +585,9 @@ static mtime_t BufferDuration( aout_instance_t * p_aout )
 /*****************************************************************************
  * OSSThread: asynchronous thread used to DMA the data to the device
  *****************************************************************************/
-static int OSSThread( aout_instance_t * p_aout )
+static void* OSSThread( vlc_object_t *p_this )
 {
+    aout_instance_t * p_aout = (aout_instance_t*)p_this;
     struct aout_sys_t * p_sys = p_aout->output.p_sys;
     mtime_t next_date = 0;
 
@@ -689,5 +690,5 @@ static int OSSThread( aout_instance_t * p_aout )
         }
     }
 
-    return VLC_SUCCESS;
+    return NULL;
 }
index 0c19f297cb90b03756617b259d5db175d6ba23f2..ac08b6c10baec715a462c079eec718f4ce51cf1a 100644 (file)
@@ -91,7 +91,7 @@ static const uint32_t pi_channels_out[] =
 #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
 
 /*****************************************************************************
@@ -572,8 +572,9 @@ 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;
@@ -649,5 +650,6 @@ static void PORTAUDIOThread( pa_thread_t *pa_thread )
         vlc_cond_signal( &pa_thread->wait );
         vlc_mutex_unlock( &pa_thread->lock_wait );
     }
+    return NULL;
 }
 #endif
index bf9ac039186fd44a0fb4954c82d4906ccbb77b7e..f7b46e8fb15aa6b3127eec6c87f1df81c99f28d0 100644 (file)
@@ -130,7 +130,7 @@ static int PlayWaveOut   ( aout_instance_t *, HWAVEOUT, WAVEHDR *,
                            aout_buffer_t *, bool );
 
 static void CALLBACK WaveOutCallback ( HWAVEOUT, UINT, DWORD, DWORD, DWORD );
-static void WaveOutThread( notification_thread_t * );
+static void* WaveOutThread( vlc_object_t * );
 
 static int VolumeInfos( aout_instance_t *, audio_volume_t * );
 static int VolumeGet( aout_instance_t *, audio_volume_t * );
@@ -969,8 +969,9 @@ static int WaveOutClearDoneBuffers(aout_sys_t *p_sys)
  * we are not authorized to use waveOutWrite() directly in the waveout
  * callback.
  *****************************************************************************/
-static void WaveOutThread( notification_thread_t *p_notif )
+static void* WaveOutThread( vlc_object_t *p_this )
 {
+    notification_thread_t *p_notif = (notification_thread_t*)p_this;
     aout_instance_t *p_aout = p_notif->p_aout;
     aout_sys_t *p_sys = p_aout->output.p_sys;
     aout_buffer_t *p_buffer = NULL;
@@ -987,7 +988,7 @@ static void WaveOutThread( notification_thread_t *p_notif )
     while( !p_sys->start_date && vlc_object_alive (p_aout) )
            WaitForSingleObject( p_sys->event, INFINITE );
     if( !vlc_object_alive (p_aout) )
-        return;
+        return NULL;
 
     msg_Dbg( p_aout, "will start to play in %"PRId64" us",
              (p_sys->start_date - AOUT_PTS_TOLERANCE/4)-mdate());
@@ -1008,7 +1009,7 @@ static void WaveOutThread( notification_thread_t *p_notif )
         /* Cleanup and find out the current latency */
         i_queued_frames = WaveOutClearDoneBuffers( p_sys );
 
-        if( !vlc_object_alive (p_aout) ) return;
+        if( !vlc_object_alive (p_aout) ) return NULL;
 
         /* Try to fill in as many frame buffers as possible */
         for( i = 0; i < FRAMES_NUM; i++ )
@@ -1084,7 +1085,7 @@ static void WaveOutThread( notification_thread_t *p_notif )
             }
         }
 
-        if( !vlc_object_alive (p_aout) ) return;
+        if( !vlc_object_alive (p_aout) ) return NULL;
 
         /*
           deal with the case that the loop didn't fillup the buffer to the
@@ -1105,6 +1106,7 @@ static void WaveOutThread( notification_thread_t *p_notif )
     }
 
 #undef waveout_warn
+    return NULL;
 }
 
 static int VolumeInfos( aout_instance_t * p_aout, audio_volume_t * pi_soft )
index 4e7a3ba90144524f4d6f8ad85b38ac0d6455d800..acd092ff7fdcaf0a4dc8aaf557604dcda329112b 100644 (file)
@@ -69,7 +69,7 @@ static block_t *EncodeVideo( encoder_t *, picture_t * );
 static block_t *EncodeAudio( encoder_t *, aout_buffer_t * );
 
 struct thread_context_t;
-static int FfmpegThread( struct thread_context_t *p_context );
+static void* FfmpegThread( vlc_object_t *p_this );
 static int FfmpegExecute( AVCodecContext *s,
                           int (*pf_func)(AVCodecContext *c2, void *arg2),
                           void **arg, int *ret, int count );
@@ -700,8 +700,9 @@ int OpenEncoder( vlc_object_t *p_this )
 /****************************************************************************
  * Ffmpeg threading system
  ****************************************************************************/
-static int FfmpegThread( struct thread_context_t *p_context )
+static void* FfmpegThread( vlc_object_t *p_this )
 {
+    struct thread_context_t *p_context = (struct thread_context_t *)p_this;
     while ( vlc_object_alive (p_context) && !p_context->b_error )
     {
         vlc_mutex_lock( &p_context->lock );
@@ -726,7 +727,7 @@ static int FfmpegThread( struct thread_context_t *p_context )
         vlc_mutex_unlock( &p_context->lock );
     }
 
-    return 0;
+    return NULL;
 }
 
 static int FfmpegExecute( AVCodecContext *s,
index 3f86707bb2ed144a49f8fb79f4a72d0293f8e7e5..8f8b5121d0cd710a2d5e5c1a4ce520d393562353 100644 (file)
@@ -59,7 +59,7 @@ int            OpenAudio    ( vlc_object_t *p_this );
 void           CloseAudio   ( vlc_object_t *p_this );
 static int     GetBufInfo       ( aout_instance_t * );
 static void    Play             ( aout_instance_t * );
-static int     QNXaoutThread    ( aout_instance_t * );
+static void*   QNXaoutThread    ( vlc_object_t * );
 
 /*****************************************************************************
  * Open : creates a handle and opens an alsa device
@@ -261,8 +261,9 @@ void CloseAudio ( vlc_object_t *p_this )
 /*****************************************************************************
  * QNXaoutThread: asynchronous thread used to DMA the data to the device
  *****************************************************************************/
-static int QNXaoutThread( aout_instance_t * p_aout )
+static void* QNXaoutThread( vlc_object_t *p_this )
 {
+    aout_instance_t * p_aout = (aout_instance_t*)p_this;
     struct aout_sys_t * p_sys = p_aout->output.p_sys;
 
     while ( vlc_object_alive (p_aout) )
@@ -320,6 +321,6 @@ static int QNXaoutThread( aout_instance_t * p_aout )
         }
     }
 
-    return 0;
+    return NULL;
 }
 
index 07306ec36d36a1437c46f324ed5ad52db54d1389..91e3b6c24f0fa3f22734cdc03a70ee5fb16ee58a 100644 (file)
@@ -51,7 +51,7 @@ static void Run    ( intf_thread_t * );
 
 static int  OpenDialogs( vlc_object_t * );
 
-static void MainLoop  ( intf_thread_t * );
+static void* MainLoop  ( intf_thread_t * );
 static void ShowDialog( intf_thread_t *, int, int, intf_dialog_args_t * );
 
 /*****************************************************************************
@@ -208,8 +208,9 @@ static void Run( intf_thread_t *p_intf )
     }
 }
 
-static void MainLoop( intf_thread_t *p_intf )
+static void* MainLoop( vlc_object_t * p_this )
 {
+    intf_thread_t *p_intf = (intf_thread_t*)p_this;
     MSG msg;
     Interface *intf = 0;
 
@@ -267,6 +268,7 @@ static void MainLoop( intf_thread_t *p_intf )
     /* Uninitialize OLE/COM */
     CoUninitialize();
 #endif
+    return NULL;
 }
 
 /*****************************************************************************
index a919fa3cb457cb1607661ff3817995a99452578b..4bdb6e11ccb1c59548719aa37c149423fd76b2cf 100644 (file)
@@ -57,7 +57,7 @@ static void Close        ( vlc_object_t * );
 static int  OpenDialogs  ( vlc_object_t * );
 
 static void Run          ( intf_thread_t * );
-static void Init         ( intf_thread_t * );
+static void* Init        ( vlc_object_t *  );
 
 static void ShowDialog   ( intf_thread_t *, int, int, intf_dialog_args_t * );
 
@@ -292,8 +292,9 @@ static void Run( intf_thread_t *p_intf )
     }
 }
 
-static void Init( intf_thread_t *p_intf )
+static void* Init( vlc_object_t * p_this )
 {
+    intf_thread_t *p_intf = (intf_thread_t*)p_this;
 #if !defined( WIN32 )
     static char  *p_args[] = { "" };
     int i_args = 1;
@@ -320,6 +321,7 @@ static void Init( intf_thread_t *p_intf )
 #else
     wxEntry( i_args, p_args );
 #endif
+    return NULL;
 }
 
 /* following functions are local */
index 2361be612129b611161a2c354f8abf39af290640..6e4a5be941cf63a4d66185cf2636fe165bfa5575 100644 (file)
@@ -162,9 +162,9 @@ static int KeyEvent( vlc_object_t *p_this, char const *psz_var,
 
 static void stop_osdvnc ( filter_t *p_filter );
 
-static void vnc_worker_thread ( vlc_object_t *p_thread_obj );
+static void* vnc_worker_thread ( vlc_object_t *p_thread_obj );
 
-static void update_request_thread( vlc_object_t *p_thread_obj );
+static void* update_request_thread( vlc_object_t *p_thread_obj );
 
 static bool open_vnc_connection ( filter_t *p_filter );
 
@@ -672,7 +672,7 @@ static bool handshaking ( filter_t *p_filter )
 
 }
 
-static void vnc_worker_thread( vlc_object_t *p_thread_obj )
+static void* vnc_worker_thread( vlc_object_t *p_thread_obj )
 {
     filter_t* p_filter = (filter_t*)(p_thread_obj->p_parent);
     filter_sys_t *p_sys = p_filter->p_sys;
@@ -799,9 +799,10 @@ exit:
     vlc_mutex_unlock( &p_sys->lock );
 
     msg_Dbg( p_filter, "VNC message reader thread ended" );
+    return NULL;
 }
 
-static void update_request_thread( vlc_object_t *p_thread_obj )
+static void* update_request_thread( vlc_object_t *p_thread_obj )
 {
     filter_t* p_filter = (filter_t*)(p_thread_obj->p_parent);
     filter_sys_t *p_sys = p_filter->p_sys;
@@ -821,7 +822,7 @@ static void update_request_thread( vlc_object_t *p_thread_obj )
     {
         msg_Err( p_filter, "Could not write rfbFramebufferUpdateRequestMsg." );
         p_sys->b_continue = false;
-        return;
+        return NULL;
     }
 
     udr.incremental = 1;
@@ -847,6 +848,7 @@ static void update_request_thread( vlc_object_t *p_thread_obj )
     }
 
     msg_Dbg( p_filter, "VNC update request thread ended" );
+    return NULL;
 }
 
 static bool process_server_message ( filter_t *p_filter,