X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Faudio_output%2Fportaudio.c;h=8d9897284c9a6176103aa1767ec6f9efe1a0b040;hb=ab055487a8e177970d51195f1b00ee4dcf5d4f2b;hp=9611a22c80407d5220f80f8cc9e1f560cdd3df98;hpb=9d5e75a7a5643a2144dc561fc246a7a3ca7e5fb0;p=vlc diff --git a/modules/audio_output/portaudio.c b/modules/audio_output/portaudio.c index 9611a22c80..8d9897284c 100644 --- a/modules/audio_output/portaudio.c +++ b/modules/audio_output/portaudio.c @@ -57,6 +57,7 @@ typedef struct pa_thread_t vlc_cond_t signal; vlc_mutex_t lock_signal; bool b_signal; + bool b_error; } pa_thread_t; @@ -110,7 +111,7 @@ vlc_module_begin () set_description( N_("PORTAUDIO audio output") ) set_category( CAT_AUDIO ) set_subcategory( SUBCAT_AUDIO_AOUT ) - add_integer( "portaudio-audio-device", 0, NULL, + add_integer( "portaudio-audio-device", 0, DEVICE_TEXT, DEVICE_LONGTEXT, false ) add_deprecated_alias( "portaudio-device" ) /* deprecated since 0.9.3 */ set_capability( "audio output", 0 ) @@ -126,6 +127,8 @@ static int paCallback( const void *inputBuffer, void *outputBuffer, const PaStreamCallbackTimeInfo *paDate, PaStreamCallbackFlags statusFlags, void *p_cookie ) { + VLC_UNUSED( inputBuffer ); VLC_UNUSED( statusFlags ); + struct aout_sys_t *p_sys = (struct aout_sys_t*) p_cookie; aout_instance_t *p_aout = p_sys->p_aout; aout_buffer_t *p_buffer; @@ -140,7 +143,7 @@ static int paCallback( const void *inputBuffer, void *outputBuffer, if( p_sys->b_chan_reorder ) { /* Do the channel reordering here */ - aout_ChannelReorder( p_buffer->p_buffer, p_buffer->i_nb_bytes, + aout_ChannelReorder( p_buffer->p_buffer, p_buffer->i_buffer, p_sys->i_channels, p_sys->pi_chan_table, p_sys->i_bits_per_sample ); } @@ -169,7 +172,6 @@ static int Open( vlc_object_t * p_this ) { aout_instance_t *p_aout = (aout_instance_t *)p_this; struct aout_sys_t * p_sys; - int i_err; msg_Dbg( p_aout, "entering Open()"); @@ -188,6 +190,8 @@ static int Open( vlc_object_t * p_this ) #ifdef PORTAUDIO_IS_SERIOUSLY_BROKEN if( !b_init ) { + int i_err; + /* Test device */ if( PAOpenDevice( p_aout ) != VLC_SUCCESS ) { @@ -216,7 +220,7 @@ static int Open( vlc_object_t * p_this ) pa_thread->b_signal = false; /* Create PORTAUDIOThread */ - if( vlc_thread_create( pa_thread, "aout", PORTAUDIOThread, + if( vlc_thread_create( pa_thread, PORTAUDIOThread, VLC_THREAD_PRIORITY_OUTPUT ) ) { msg_Err( p_aout, "cannot create PORTAUDIO thread" ); @@ -423,14 +427,14 @@ static int PAOpenDevice( aout_instance_t *p_aout ) if( p_sys->deviceInfo->maxOutputChannels >= 6 ) { val.i_int = AOUT_VAR_5_1; - text.psz_string = "5.1"; + text.psz_string = _("5.1"); var_Change( p_aout, "audio-device", VLC_VAR_ADDCHOICE, &val, &text ); msg_Dbg( p_aout, "device supports 5.1 channels" ); } var_AddCallback( p_aout, "audio-device", aout_ChannelsRestart, NULL ); - var_SetBool( p_aout, "intf-change", true ); + var_TriggerCallback( p_aout, "intf-change" ); } /* Audio format is paFloat32 (always supported by portaudio v19) */