X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Faudio_output%2Fsdl.c;h=7dc215f1e4d4cb23a159d5fde676d6d7fd2335b6;hb=a5c83dda798f93cc7a76bbb50d89352117e6ec46;hp=6bade6419e1a2a76709ac0b0126698525e6150ee;hpb=f485214f09dd284cbb85674e937fbbb0a6032a2e;p=vlc diff --git a/modules/audio_output/sdl.c b/modules/audio_output/sdl.c index 6bade6419e..7dc215f1e4 100644 --- a/modules/audio_output/sdl.c +++ b/modules/audio_output/sdl.c @@ -27,13 +27,15 @@ /***************************************************************************** * Preamble *****************************************************************************/ -#include /* strerror() */ #include /* write(), close() */ -#include /* calloc(), malloc(), free() */ -#include -#include -#include "aout_internal.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include #include SDL_INCLUDE_FILE @@ -57,14 +59,14 @@ struct aout_sys_t static int Open ( vlc_object_t * ); static void Close ( vlc_object_t * ); static void Play ( aout_instance_t * ); -static void SDLCallback ( void *, byte_t *, int ); +static void SDLCallback ( void *, uint8_t *, int ); /***************************************************************************** * Module descriptor *****************************************************************************/ vlc_module_begin(); set_shortname( "SDL" ); - set_description( _("Simple DirectMedia Layer audio output") ); + set_description( N_("Simple DirectMedia Layer audio output") ); set_capability( "audio output", 40 ); set_category( CAT_AUDIO ); set_subcategory( SUBCAT_AUDIO_AOUT ); @@ -93,7 +95,7 @@ static int Open ( vlc_object_t *p_this ) /* Win32 SDL implementation doesn't support SDL_INIT_EVENTTHREAD yet */ i_flags |= SDL_INIT_EVENTTHREAD; #endif -#ifdef DEBUG +#ifndef NDEBUG /* In debug mode you may want vlc to dump a core instead of staying * stuck */ i_flags |= SDL_INIT_NOPARACHUTE; @@ -213,7 +215,7 @@ static int Open ( vlc_object_t *p_this ) var_AddCallback( p_aout, "audio-device", aout_ChannelsRestart, NULL ); } - val.b_bool = VLC_TRUE; + val.b_bool = true; var_Set( p_aout, "intf-change", val ); p_aout->output.output.i_rate = obtained.freq; @@ -228,6 +230,7 @@ static int Open ( vlc_object_t *p_this ) *****************************************************************************/ static void Play( aout_instance_t * p_aout ) { + VLC_UNUSED(p_aout); } /***************************************************************************** @@ -235,6 +238,7 @@ static void Play( aout_instance_t * p_aout ) *****************************************************************************/ static void Close ( vlc_object_t *p_this ) { + VLC_UNUSED(p_this); SDL_PauseAudio( 1 ); SDL_CloseAudio(); SDL_QuitSubSystem( SDL_INIT_AUDIO ); @@ -243,7 +247,7 @@ static void Close ( vlc_object_t *p_this ) /***************************************************************************** * SDLCallback: what to do once SDL has played sound samples *****************************************************************************/ -static void SDLCallback( void * _p_aout, byte_t * p_stream, int i_len ) +static void SDLCallback( void * _p_aout, uint8_t * p_stream, int i_len ) { aout_instance_t * p_aout = (aout_instance_t *)_p_aout; aout_buffer_t * p_buffer; @@ -258,12 +262,12 @@ static void SDLCallback( void * _p_aout, byte_t * p_stream, int i_len ) if ( p_buffer != NULL ) { - p_aout->p_libvlc->pf_memcpy( p_stream, p_buffer->p_buffer, i_len ); + vlc_memcpy( p_stream, p_buffer->p_buffer, i_len ); aout_BufferFree( p_buffer ); } else { - p_aout->p_libvlc->pf_memset( p_stream, 0, i_len ); + vlc_memset( p_stream, 0, i_len ); } }