[vlc-commits] wasapi: write timings to debug log

Rémi Denis-Courmont git at videolan.org
Wed Mar 12 21:45:12 CET 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Mar 12 22:43:38 2014 +0200| [b52247039589ac093f16ed971939e6c17b8ea962] | committer: Rémi Denis-Courmont

wasapi: write timings to debug log

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b52247039589ac093f16ed971939e6c17b8ea962
---

 modules/audio_output/wasapi.c |   17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/modules/audio_output/wasapi.c b/modules/audio_output/wasapi.c
index 243971e..ea58ad6 100644
--- a/modules/audio_output/wasapi.c
+++ b/modules/audio_output/wasapi.c
@@ -213,9 +213,12 @@ static HRESULT Flush(aout_stream_t *s)
 
     hr = IAudioClient_Reset(sys->client);
     if (FAILED(hr))
-        msg_Warn(s, "cannot reset stream (error 0x%lx)", hr);
-    else
+    {
+        msg_Dbg(s, "reset");
         sys->written = 0;
+    }
+    else
+        msg_Warn(s, "cannot reset stream (error 0x%lx)", hr);
     return hr;
 }
 
@@ -380,6 +383,16 @@ static HRESULT Start(aout_stream_t *s, audio_sample_format_t *restrict fmt,
         msg_Err(s, "cannot get buffer size (error 0x%lx)", hr);
         goto error;
     }
+    msg_Dbg(s, "buffer size    : %"PRIu32" frames", sys->frames);
+
+    REFERENCE_TIME latT, defT, minT;
+    if (SUCCEEDED(IAudioClient_GetStreamLatency(sys->client, &latT))
+     && SUCCEEDED(IAudioClient_GetDevicePeriod(sys->client, &defT, &minT)))
+    {
+        msg_Dbg(s, "maximum latency: %"PRIu64"00 ns", latT);
+        msg_Dbg(s, "default period : %"PRIu64"00 ns", defT);
+        msg_Dbg(s, "minimum period : %"PRIu64"00 ns", minT);
+    }
 
     sys->rate = fmt->i_rate;
     sys->bytes_per_frame = fmt->i_bytes_per_frame;



More information about the vlc-commits mailing list