From: Rafaël Carré Date: Mon, 14 Jan 2008 10:37:30 +0000 (+0000) Subject: alsa: add some verbose debug (enabled only if ALSA_DEBUG is defined) due to some... X-Git-Tag: 0.9.0-test0~3474 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=fa45d63fdedc4cce1de4257b35de5adfb494d544;p=vlc alsa: add some verbose debug (enabled only if ALSA_DEBUG is defined) due to some regressions introduced by changeset [23022] --- diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c index 28bc6f2a51..2ce95e5206 100644 --- a/modules/audio_output/alsa.c +++ b/modules/audio_output/alsa.c @@ -40,6 +40,8 @@ #define ALSA_PCM_NEW_SW_PARAMS_API #include +/*#define ALSA_DEBUG*/ + /***************************************************************************** * aout_sys_t: ALSA audio output method descriptor ***************************************************************************** @@ -832,6 +834,20 @@ static void ALSAFill( aout_instance_t * p_aout ) / p_aout->output.output.i_bytes_per_frame / p_aout->output.output.i_rate * p_aout->output.output.i_frame_length ); + +#ifdef ALSA_DEBUG + snd_pcm_state_t state = snd_pcm_status_get_state( p_status ); + if( state != SND_PCM_STATE_RUNNING ) + msg_Err( p_aout, "pcm status (%d) != RUNNING", state ); + + msg_Dbg( p_aout, "Delay is %ld frames (%d bytes)", delay, i_bytes ); + + msg_Dbg( p_aout, "Bytes per frame: %d", p_aout->output.output.i_bytes_per_frame ); + msg_Dbg( p_aout, "Rate: %d", p_aout->output.output.i_rate ); + msg_Dbg( p_aout, "Frame length: %d", p_aout->output.output.i_frame_length ); + + msg_Dbg( p_aout, "Next date is in %d microseconds", (int)(next_date - mdate()) ); +#endif } p_buffer = aout_OutputNextBuffer( p_aout, next_date,