]> git.sesse.net Git - vlc/commitdiff
alsa: add some verbose debug (enabled only if ALSA_DEBUG is defined) due to some...
authorRafaël Carré <funman@videolan.org>
Mon, 14 Jan 2008 10:37:30 +0000 (10:37 +0000)
committerRafaël Carré <funman@videolan.org>
Mon, 14 Jan 2008 10:37:30 +0000 (10:37 +0000)
modules/audio_output/alsa.c

index 28bc6f2a514eba73bb8b45c29fc9947077a7052f..2ce95e52063eced728e2ba02481a98931798e242 100644 (file)
@@ -40,6 +40,8 @@
 #define ALSA_PCM_NEW_SW_PARAMS_API
 #include <alsa/asoundlib.h>
 
+/*#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,