diff options
author | Chris Robinson <[email protected]> | 2018-12-29 12:26:45 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-12-29 12:26:45 -0800 |
commit | 8a84e7b662959015ee1e7d066351e5b7cc4fe283 (patch) | |
tree | 61d58fc4dc8d638ee45dff138754d1ccef84bd53 /Alc/backends | |
parent | 9b0b722d7209d3cb8a31ba0823ef252906e2eb5d (diff) |
Use member functions for the sample and channel converters
Diffstat (limited to 'Alc/backends')
-rw-r--r-- | Alc/backends/coreaudio.cpp | 7 | ||||
-rw-r--r-- | Alc/backends/wasapi.cpp | 10 |
2 files changed, 8 insertions, 9 deletions
diff --git a/Alc/backends/coreaudio.cpp b/Alc/backends/coreaudio.cpp index 2caa0852..c5da9f24 100644 --- a/Alc/backends/coreaudio.cpp +++ b/Alc/backends/coreaudio.cpp @@ -656,14 +656,13 @@ 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>(SampleConverterInput(mConverter.get(), &src0, &src0len, - buffer, samples)); + auto got = static_cast<ALuint>(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>(SampleConverterInput(mConverter.get(), &src1, &src1len, + got += static_cast<ALuint>(mConverter->convert(&src1, &src1len, static_cast<char*>(buffer)+got, samples-got)); total_read += rec_vec.second.len - src1len; } @@ -675,7 +674,7 @@ ALCenum CoreAudioCapture::captureSamples(void *buffer, ALCuint samples) ALCuint CoreAudioCapture::availableSamples() { if(!mConverter) return mRing->readSpace(); - return SampleConverterAvailableOut(mConverter.get(), mRing->readSpace()); + return mConverter->availableOut(mRing->readSpace()); } } // namespace diff --git a/Alc/backends/wasapi.cpp b/Alc/backends/wasapi.cpp index d6b50985..cb0b665b 100644 --- a/Alc/backends/wasapi.cpp +++ b/Alc/backends/wasapi.cpp @@ -1223,7 +1223,7 @@ FORCE_ALIGN int WasapiCapture::recordProc() if(mChannelConv) { samples.resize(numsamples*2); - ChannelConverterInput(mChannelConv.get(), rdata, samples.data(), numsamples); + mChannelConv->convert(rdata, samples.data(), numsamples); rdata = reinterpret_cast<BYTE*>(samples.data()); } @@ -1235,16 +1235,16 @@ FORCE_ALIGN int WasapiCapture::recordProc() const ALvoid *srcdata{rdata}; auto srcframes = static_cast<ALsizei>(numsamples); - dstframes = SampleConverterInput(mSampleConv.get(), &srcdata, &srcframes, - data.first.buf, (ALsizei)minz(data.first.len, INT_MAX)); + dstframes = mSampleConv->convert(&srcdata, &srcframes, data.first.buf, + static_cast<ALsizei>(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 * block was filled, and there's space in the second * dest block, do another run for the second block. */ - dstframes += SampleConverterInput(mSampleConv.get(), &srcdata, &srcframes, - data.second.buf, (ALsizei)minz(data.second.len, INT_MAX)); + dstframes += mSampleConv->convert(&srcdata, &srcframes, data.second.buf, + static_cast<ALsizei>(minz(data.second.len, INT_MAX))); } } else |