[vlc-devel] [PATCH 5/9] wasapi: fix buffer_duration for hdmi formats

Thomas Guillem thomas at gllm.fr
Wed Oct 5 18:37:48 CEST 2016


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

diff --git a/modules/audio_output/wasapi.c b/modules/audio_output/wasapi.c
index b13dedf..f6ddc3f 100644
--- a/modules/audio_output/wasapi.c
+++ b/modules/audio_output/wasapi.c
@@ -470,9 +470,12 @@ static HRESULT Start(aout_stream_t *s, audio_sample_format_t *restrict pfmt,
     {
         vlc_HdmiToWave(&wf_iec61937, &fmt);
         shared_mode = AUDCLNT_SHAREMODE_EXCLUSIVE;
+
         /* Less buffer duration for these very high sample rate codecs
-         * (IAudioClient_Initialize return an out of memory error if higher) */
-        buffer_duration = AOUT_MAX_PREPARE_TIME * 5;
+         * (IAudioClient_Initialize return an out of memory error if higher).
+         * It seems that the max buffer size for EXCLUSIVE/HDMI is 1MB (there
+         * is no such limitation for PCM). */
+        buffer_duration = CLOCK_FREQ * 10 * 1024 * 1024 / pwf->nAvgBytesPerSec;
     }
     else
     {
-- 
2.9.3



More information about the vlc-devel mailing list