aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends
diff options
context:
space:
mode:
Diffstat (limited to 'alc/backends')
-rw-r--r--alc/backends/coreaudio.cpp9
-rw-r--r--alc/backends/wasapi.cpp10
2 files changed, 9 insertions, 10 deletions
diff --git a/alc/backends/coreaudio.cpp b/alc/backends/coreaudio.cpp
index cfa7703a..c903ff07 100644
--- a/alc/backends/coreaudio.cpp
+++ b/alc/backends/coreaudio.cpp
@@ -654,15 +654,14 @@ ALCenum CoreAudioCapture::captureSamples(void *buffer, ALCuint samples)
auto rec_vec = mRing->getReadVector();
const void *src0{rec_vec.first.buf};
- auto src0len = static_cast<ALsizei>(rec_vec.first.len);
- auto got = static_cast<ALuint>(mConverter->convert(&src0, &src0len, buffer, samples));
+ auto src0len = static_cast<ALuint>(rec_vec.first.len);
+ ALuint got{mConverter->convert(&src0, &src0len, buffer, samples)};
size_t total_read{rec_vec.first.len - src0len};
if(got < samples && !src0len && rec_vec.second.len > 0)
{
const void *src1{rec_vec.second.buf};
- auto src1len = static_cast<ALsizei>(rec_vec.second.len);
- got += static_cast<ALuint>(mConverter->convert(&src1, &src1len,
- static_cast<char*>(buffer)+got, samples-got));
+ auto src1len = static_cast<ALuint>(rec_vec.second.len);
+ got += mConverter->convert(&src1, &src1len, static_cast<char*>(buffer)+got, samples-got);
total_read += rec_vec.second.len - src1len;
}
diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp
index cc53be66..dbf1208d 100644
--- a/alc/backends/wasapi.cpp
+++ b/alc/backends/wasapi.cpp
@@ -1229,10 +1229,10 @@ FORCE_ALIGN int WasapiCapture::recordProc()
if(mSampleConv)
{
const ALvoid *srcdata{rdata};
- auto srcframes = static_cast<ALsizei>(numsamples);
+ ALuint srcframes{numsamples};
dstframes = mSampleConv->convert(&srcdata, &srcframes, data.first.buf,
- static_cast<ALsizei>(minz(data.first.len, INT_MAX)));
+ static_cast<ALuint>(minz(data.first.len, INT_MAX)));
if(srcframes > 0 && dstframes == data.first.len && data.second.len > 0)
{
/* If some source samples remain, all of the first dest
@@ -1240,14 +1240,14 @@ FORCE_ALIGN int WasapiCapture::recordProc()
* dest block, do another run for the second block.
*/
dstframes += mSampleConv->convert(&srcdata, &srcframes, data.second.buf,
- static_cast<ALsizei>(minz(data.second.len, INT_MAX)));
+ static_cast<ALuint>(minz(data.second.len, INT_MAX)));
}
}
else
{
const auto framesize = static_cast<ALuint>(mDevice->frameSizeFromFmt());
- size_t len1 = minz(data.first.len, numsamples);
- size_t len2 = minz(data.second.len, numsamples-len1);
+ size_t len1{minz(data.first.len, numsamples)};
+ size_t len2{minz(data.second.len, numsamples-len1)};
memcpy(data.first.buf, rdata, len1*framesize);
if(len2 > 0)