aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-04-14 01:57:18 +0200
committerdec05eba <dec05eba@protonmail.com>2024-04-14 01:57:18 +0200
commit34210f6028edcb1ea40eed351d2575a67a2df1c4 (patch)
tree7c3678712fb7d29100f0f186c40d07b51c4b41d8
parent50ff9fb615aa53ece4462bb67e7f4e78acd64847 (diff)
minreq
-rw-r--r--src/sound.cpp4
1 files changed, 2 insertions, 2 deletions
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);