[vlc-devel] [PATCH 06/10] wasapi: set max buffer duration to 2 seconds in exclusive mode
Jean-Baptiste Kempf
jb at videolan.org
Wed Jan 18 09:53:29 CET 2017
OK
On Wed, 18 Jan 2017, at 09:20, Thomas Guillem wrote:
> See AUDCLNT_E_BUFFER_SIZE_ERROR in IAudioClient::Initialize msdn doc.
> ---
> modules/audio_output/wasapi.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/modules/audio_output/wasapi.c
> b/modules/audio_output/wasapi.c
> index cafca6b0d7..424a4961e2 100644
> --- a/modules/audio_output/wasapi.c
> +++ b/modules/audio_output/wasapi.c
> @@ -472,18 +472,15 @@ static HRESULT Start(aout_stream_t *s,
> audio_sample_format_t *restrict pfmt,
> {
> vlc_SpdifToWave(pwfe, &fmt);
> shared_mode = AUDCLNT_SHAREMODE_EXCLUSIVE;
> - buffer_duration = AOUT_MAX_PREPARE_TIME * 10;
> + /* The max buffer duration in exclusive mode is 2 seconds */
> + buffer_duration = AOUT_MAX_PREPARE_TIME;
> }
> else if (AOUT_FMT_HDMI(&fmt))
> {
> 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).
> - * 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;
> + /* The max buffer duration in exclusive mode is 2 seconds */
> + buffer_duration = AOUT_MAX_PREPARE_TIME;
> }
> else if (AOUT_FMT_LINEAR(&fmt))
> {
> --
> 2.11.0
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
--
Jean-Baptiste Kempf - President
+33 672 704 734
More information about the vlc-devel
mailing list