X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Faudio_output%2Fhd1000a.cpp;h=57c5bc2a1f0e27e2acb4583e89bea10330e2f439;hb=96b4ee1ee2da310e9ea951a29672a7609dbf831e;hp=38d71773f685893bad5035943ed5b8bf4e3ba7b9;hpb=99fab9089e9e1709d9c3a4bc5ced0c137ac59134;p=vlc diff --git a/modules/audio_output/hd1000a.cpp b/modules/audio_output/hd1000a.cpp index 38d71773f6..57c5bc2a1f 100644 --- a/modules/audio_output/hd1000a.cpp +++ b/modules/audio_output/hd1000a.cpp @@ -32,7 +32,8 @@ extern "C" # include "config.h" #endif -#include +#include +#include #include #include "aout_internal.h" @@ -75,7 +76,7 @@ static void InterleaveS16( int16_t *, int16_t * ); *****************************************************************************/ vlc_module_begin(); set_shortname( "Roku HD1000" ); - set_description( _("Roku HD1000 audio output") ); + set_description( N_("Roku HD1000 audio output") ); set_capability( "audio output", 100 ); set_category( CAT_AUDIO ); set_subcategory( SUBCAT_AUDIO_AOUT ); @@ -96,18 +97,14 @@ static int Open( vlc_object_t * p_this ) p_aout->output.p_sys = p_sys = (aout_sys_t *)malloc( sizeof( aout_sys_t ) ); if( p_aout->output.p_sys == NULL ) - { - msg_Err( p_aout, "out of memory" ); - return VLC_EGENERIC; - } + return VLC_ENOMEM; /* New PCMAudioPlayer */ p_sys->pPlayer = pPlayer = new PCMAudioPlayer(); if( p_sys->pPlayer == NULL ) { - msg_Err( p_aout, "out of memory" ); free( p_sys ); - return VLC_EGENERIC; + return VLC_ENOMEM; } /* Get Buffer Requirements */ @@ -126,10 +123,9 @@ static int Open( vlc_object_t * p_this ) p_sys->ppBuffers = (void **)malloc( p_sys->nBuffers * sizeof( void * ) ); if( p_sys->ppBuffers == NULL ) { - msg_Err( p_aout, "out of memory" ); delete pPlayer; free( p_sys ); - return VLC_EGENERIC; + return VLC_ENOMEM; } /* Open PCMAudioPlayer */ @@ -172,7 +168,7 @@ static int Open( vlc_object_t * p_this ) /* Create thread and wait for its readiness. */ if( vlc_thread_create( p_aout, "aout", Thread, - VLC_THREAD_PRIORITY_OUTPUT, VLC_FALSE ) ) + VLC_THREAD_PRIORITY_OUTPUT, false ) ) { msg_Err( p_aout, "cannot create OSS thread (%m)" ); pPlayer->Close(); @@ -196,7 +192,7 @@ static void Close( vlc_object_t * p_this ) vlc_object_kill( p_aout ); vlc_thread_join( p_aout ); - p_aout->b_die = VLC_FALSE; + p_aout->b_die = false; do { @@ -226,7 +222,7 @@ static int Thread( aout_instance_t * p_aout ) struct aout_sys_t * p_sys = p_aout->output.p_sys; PCMAudioPlayer * pPlayer = p_sys->pPlayer; - while( !p_aout->b_die ) + while( vlc_object_alive (p_aout) ) { pPlayer->WaitForBuffer(); @@ -237,7 +233,7 @@ static int Thread( aout_instance_t * p_aout ) #define i p_sys->nNextBufferIndex if( p_buffer == NULL ) { - p_aout->p_libvlc->pf_memset( p_sys->ppBuffers[ i ], 0, + vlc_memset( p_aout, p_sys->ppBuffers[ i ], 0, p_sys->nBufferSize ); } else