From 34210f6028edcb1ea40eed351d2575a67a2df1c4 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 14 Apr 2024 01:57:18 +0200 Subject: minreq --- src/sound.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/sound.cpp b/src/sound.cpp index 4841f70..1d01d32 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -252,11 +252,11 @@ int sound_device_get_by_name(SoundDevice *device, const char *device_name, const ss.channels = num_channels; pa_buffer_attr buffer_attr; + buffer_attr.fragsize = period_frame_size * audio_format_to_get_bytes_per_sample(audio_format) * num_channels; // 2/4 bytes/sample, @num_channels channels buffer_attr.tlength = -1; buffer_attr.prebuf = -1; - buffer_attr.minreq = -1; + buffer_attr.minreq = buffer_attr.fragsize; buffer_attr.maxlength = -1; - buffer_attr.fragsize = period_frame_size * audio_format_to_get_bytes_per_sample(audio_format) * num_channels; // 2/4 bytes/sample, @num_channels channels int error = 0; pa_handle *handle = pa_sound_device_new(nullptr, description, device_name, description, &ss, &buffer_attr, &error); -- cgit v1.2.3