[vlc-commits] audiotrack: debug delays
Thomas Guillem
git at videolan.org
Wed Apr 15 17:27:07 CEST 2015
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Apr 15 12:17:29 2015 +0200| [ce58d9dda1051b8fd8cbc3e5d7c439457e8802e5] | committer: Thomas Guillem
audiotrack: debug delays
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ce58d9dda1051b8fd8cbc3e5d7c439457e8802e5
---
modules/audio_output/audiotrack.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/modules/audio_output/audiotrack.c b/modules/audio_output/audiotrack.c
index 14a6e53..0e78326 100644
--- a/modules/audio_output/audiotrack.c
+++ b/modules/audio_output/audiotrack.c
@@ -651,6 +651,26 @@ TimeGet( audio_output_t *p_aout, mtime_t *restrict p_delay )
if( i_audiotrack_us <= 0 )
i_audiotrack_us = AudioTrack_GetSmoothPositionUs(env, p_aout );
+/* Debug log for both delays */
+#if 0
+{
+ mtime_t i_written_us = FRAMES_TO_US( p_sys->i_samples_written );
+ mtime_t i_ts_us = AudioTrack_GetTimestampPositionUs( env, p_aout );
+ mtime_t i_smooth_us = 0;
+
+ if( i_ts_us > 0 )
+ i_smooth_us = AudioTrack_GetSmoothPositionUs(env, p_aout );
+ else if ( p_sys->smoothpos.i_us != 0 )
+ i_smooth_us = p_sys->smoothpos.i_us + mdate()
+ - p_sys->smoothpos.i_latency_us;
+
+ msg_Err( p_aout, "TimeGet: TimeStamp: %lld, Smooth: %lld (latency: %lld)",
+ i_ts_us ? i_written_us - i_ts_us : 0,
+ i_smooth_us ? i_written_us - i_smooth_us : 0,
+ p_sys->smoothpos.i_latency_us );
+}
+#endif
+
if( i_audiotrack_us > 0 )
{
mtime_t i_delay = FRAMES_TO_US( p_sys->i_samples_written )
More information about the vlc-commits
mailing list