From: RĂ©mi Duraffort Date: Mon, 11 Aug 2008 18:46:04 +0000 (+0200) Subject: Use the right declaration for threaded functions. X-Git-Tag: 0.9.0~447 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=a48fa0327705ef15ba4356f48f375eee0fb3dca9;p=vlc Use the right declaration for threaded functions. --- diff --git a/modules/access_output/bonjour.c b/modules/access_output/bonjour.c index 37814deb0d..6b472b4ccf 100644 --- a/modules/access_output/bonjour.c +++ b/modules/access_output/bonjour.c @@ -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; } /***************************************************************************** diff --git a/modules/access_output/rtmp.c b/modules/access_output/rtmp.c index a26690a097..ebf7175ab6 100644 --- a/modules/access_output/rtmp.c +++ b/modules/access_output/rtmp.c @@ -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; } diff --git a/modules/access_output/udp.c b/modules/access_output/udp.c index 14da8aa416..2cadddf90b 100644 --- a/modules/access_output/udp.c +++ b/modules/access_output/udp.c @@ -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; } diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c index e16a05f785..325fa5f733 100644 --- a/modules/audio_output/alsa.c +++ b/modules/audio_output/alsa.c @@ -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; } /***************************************************************************** diff --git a/modules/audio_output/directx.c b/modules/audio_output/directx.c index 6c7228e7dc..ff4f312d22 100644 --- a/modules/audio_output/directx.c +++ b/modules/audio_output/directx.c @@ -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; } diff --git a/modules/audio_output/hd1000a.cpp b/modules/audio_output/hd1000a.cpp index 57c5bc2a1f..3604c6ea01 100644 --- a/modules/audio_output/hd1000a.cpp +++ b/modules/audio_output/hd1000a.cpp @@ -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; } /***************************************************************************** diff --git a/modules/audio_output/oss.c b/modules/audio_output/oss.c index 929aeacb7e..0f1377ea7b 100644 --- a/modules/audio_output/oss.c +++ b/modules/audio_output/oss.c @@ -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; } diff --git a/modules/audio_output/portaudio.c b/modules/audio_output/portaudio.c index 0c19f297cb..ac08b6c10b 100644 --- a/modules/audio_output/portaudio.c +++ b/modules/audio_output/portaudio.c @@ -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 diff --git a/modules/audio_output/waveout.c b/modules/audio_output/waveout.c index bf9ac03918..f7b46e8fb1 100644 --- a/modules/audio_output/waveout.c +++ b/modules/audio_output/waveout.c @@ -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 ) diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c index 4e7a3ba901..acd092ff7f 100644 --- a/modules/codec/avcodec/encoder.c +++ b/modules/codec/avcodec/encoder.c @@ -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, diff --git a/modules/gui/qnx/aout.c b/modules/gui/qnx/aout.c index 3f86707bb2..8f8b5121d0 100644 --- a/modules/gui/qnx/aout.c +++ b/modules/gui/qnx/aout.c @@ -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; } diff --git a/modules/gui/wince/wince.cpp b/modules/gui/wince/wince.cpp index 07306ec36d..91e3b6c24f 100644 --- a/modules/gui/wince/wince.cpp +++ b/modules/gui/wince/wince.cpp @@ -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; } /***************************************************************************** diff --git a/modules/gui/wxwidgets/wxwidgets.cpp b/modules/gui/wxwidgets/wxwidgets.cpp index a919fa3cb4..4bdb6e11cc 100644 --- a/modules/gui/wxwidgets/wxwidgets.cpp +++ b/modules/gui/wxwidgets/wxwidgets.cpp @@ -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 */ diff --git a/modules/video_filter/remoteosd.c b/modules/video_filter/remoteosd.c index 2361be6121..6e4a5be941 100644 --- a/modules/video_filter/remoteosd.c +++ b/modules/video_filter/remoteosd.c @@ -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,