aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/alsa.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-19 04:46:49 -0800
committerChris Robinson <[email protected]>2018-11-19 04:46:49 -0800
commitad5f9d9b22f8860f0c6ca06004c134182dda95df (patch)
treeaac46dac1585e5f58ba8bc1be6bb06d3a36e9ab6 /Alc/backends/alsa.cpp
parenta14f39ea06a458e6b3b70e0428264967847da7f4 (diff)
Return the ringbuffer data pointers as a pair
Diffstat (limited to 'Alc/backends/alsa.cpp')
-rw-r--r--Alc/backends/alsa.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/Alc/backends/alsa.cpp b/Alc/backends/alsa.cpp
index b3adfafa..e1e861db 100644
--- a/Alc/backends/alsa.cpp
+++ b/Alc/backends/alsa.cpp
@@ -1237,12 +1237,11 @@ ALCuint ALCcaptureAlsa_availableSamples(ALCcaptureAlsa *self)
while(avail > 0)
{
- ll_ringbuffer_data_t vec[2];
- ll_ringbuffer_get_write_vector(self->ring, vec);
- if(vec[0].len == 0) break;
+ auto vec = ll_ringbuffer_get_write_vector(self->ring);
+ if(vec.first.len == 0) break;
- snd_pcm_sframes_t amt{std::min<snd_pcm_sframes_t>(vec[0].len, avail)};
- amt = snd_pcm_readi(self->pcmHandle, vec[0].buf, amt);
+ snd_pcm_sframes_t amt{std::min<snd_pcm_sframes_t>(vec.first.len, avail)};
+ amt = snd_pcm_readi(self->pcmHandle, vec.first.buf, amt);
if(amt < 0)
{
ERR("read error: %s\n", snd_strerror(amt));