[vlc-commits] [Git][videolan/vlc][3.0.x] wasapi: initialize IAudioClient::Initialize() hnsBufferDuration/hnsPeriodicity to 0 in shared mode

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Mar 14 03:00:56 UTC 2026



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
9afc1382 by Steve Lhomme at 2026-03-14T02:41:31+00:00
wasapi: initialize IAudioClient::Initialize() hnsBufferDuration/hnsPeriodicity to 0 in shared mode

>From the documentation [^1]:
> For a shared-mode stream that uses event-driven buffering, the caller must
> set both hnsPeriodicity and hnsBufferDuration to 0.

[^1]: https://learn.microsoft.com/en-us/windows/win32/api/audioclient/nf-audioclient-iaudioclient-initialize

(cherry picked from commit fdefe5c6346f4fcdf076030ef14ed75bf476fb4e) (edited)
edited:
- in 3.0 the audio output doesn't use the event-driven mode (AUDCLNT_STREAMFLAGS_EVENTCALLBACK)

- - - - -


1 changed file:

- modules/access/wasapi.c


Changes:

=====================================
modules/access/wasapi.c
=====================================
@@ -256,6 +256,9 @@ static es_out_id_t *CreateES(demux_t *demux, IAudioClient *client, bool loop,
     /* Request at least thrice the PTS delay */
     REFERENCE_TIME bufsize = caching * INT64_C(10) * 3;
 
+    if (flags == AUDCLNT_STREAMFLAGS_EVENTCALLBACK)
+        bufsize = 0;
+
     hr = IAudioClient_Initialize(client, AUDCLNT_SHAREMODE_SHARED, flags,
                                  bufsize, 0, pwf, NULL);
     CoTaskMemFree(pwf);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/9afc138206fda201effe58574eb397f07543c5af

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/9afc138206fda201effe58574eb397f07543c5af
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list