X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Faudio_output%2Fsdl.c;h=7dc215f1e4d4cb23a159d5fde676d6d7fd2335b6;hb=da12022b26ca3f95c4038ceb73926603c27b8f1e;hp=f34a145b21cdd773bdd4464ae7506c0bba56ff1a;hpb=2cb472dba008f7d877ffe6bae9c5575253365282;p=vlc diff --git a/modules/audio_output/sdl.c b/modules/audio_output/sdl.c index f34a145b21..7dc215f1e4 100644 --- a/modules/audio_output/sdl.c +++ b/modules/audio_output/sdl.c @@ -27,15 +27,15 @@ /***************************************************************************** * Preamble *****************************************************************************/ -#include /* ENOMEM */ -#include /* open(), O_WRONLY */ -#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 @@ -59,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 ); @@ -95,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; @@ -215,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; @@ -230,6 +230,7 @@ static int Open ( vlc_object_t *p_this ) *****************************************************************************/ static void Play( aout_instance_t * p_aout ) { + VLC_UNUSED(p_aout); } /***************************************************************************** @@ -237,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 ); @@ -245,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; @@ -260,12 +262,12 @@ static void SDLCallback( void * _p_aout, byte_t * p_stream, int i_len ) if ( p_buffer != NULL ) { - p_aout->p_vlc->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_vlc->pf_memset( p_stream, 0, i_len ); + vlc_memset( p_stream, 0, i_len ); } }