diff options
author | Chris Robinson <[email protected]> | 2018-12-19 05:57:36 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-12-19 05:57:36 -0800 |
commit | 0214a1102497003df07f354adc1e77d2b3185953 (patch) | |
tree | 5b39e70dc19752eb620767991a0bddf68ee22faf /Alc/backends/sndio.cpp | |
parent | b49e8985a47f384dfde0ddd04d97426e3c37f480 (diff) |
Use inline methods for the device format sizes
Diffstat (limited to 'Alc/backends/sndio.cpp')
-rw-r--r-- | Alc/backends/sndio.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Alc/backends/sndio.cpp b/Alc/backends/sndio.cpp index 1dabe5ca..9ebad671 100644 --- a/Alc/backends/sndio.cpp +++ b/Alc/backends/sndio.cpp @@ -97,7 +97,7 @@ static int SndioPlayback_mixerProc(SndioPlayback *self) SetRTPriority(); althrd_setname(MIXER_THREAD_NAME); - frameSize = FrameSizeFromDevFmt(device->FmtChans, device->FmtType, device->mAmbiOrder); + frameSize = device->frameSizeFromFmt(); while(!self->mKillNow.load(std::memory_order_acquire) && device->Connected.load(std::memory_order_acquire)) @@ -238,9 +238,7 @@ static ALCboolean SndioPlayback_start(SndioPlayback *self) { ALCdevice *device = STATIC_CAST(ALCbackend,self)->mDevice; - self->data_size = device->UpdateSize * FrameSizeFromDevFmt( - device->FmtChans, device->FmtType, device->mAmbiOrder - ); + self->data_size = device->UpdateSize * device->frameSizeFromFmt(); al_free(self->mix_data); self->mix_data = al_calloc(16, self->data_size); @@ -334,7 +332,7 @@ static int SndioCapture_recordProc(SndioCapture *self) SetRTPriority(); althrd_setname(RECORD_THREAD_NAME); - frameSize = FrameSizeFromDevFmt(device->FmtChans, device->FmtType, device->mAmbiOrder); + frameSize = device->frameSizeFromFmt(); while(!self->mKillNow.load(std::memory_order_acquire) && device->Connected.load(std::memory_order_acquire)) @@ -433,7 +431,7 @@ static ALCenum SndioCapture_open(SndioCapture *self, const ALCchar *name) par.bits = par.bps * 8; par.le = SIO_LE_NATIVE; par.msb = SIO_LE_NATIVE ? 0 : 1; - par.rchan = ChannelsFromDevFmt(device->FmtChans, device->mAmbiOrder); + par.rchan = device->channelsFromFmt(); par.rate = device->Frequency; par.appbufsz = maxu(device->UpdateSize*device->NumUpdates, (device->Frequency+9)/10); @@ -461,7 +459,7 @@ static ALCenum SndioCapture_open(SndioCapture *self, const ALCchar *name) (device->FmtType == DevFmtUShort && par.bits == 16 && par.sig == 0) || (device->FmtType == DevFmtInt && par.bits == 32 && par.sig != 0) || (device->FmtType == DevFmtUInt && par.bits == 32 && par.sig == 0)) || - ChannelsFromDevFmt(device->FmtChans, device->mAmbiOrder) != (ALsizei)par.rchan || + device->channelsFromFmt() != (ALsizei)par.rchan || device->Frequency != par.rate) { ERR("Failed to set format %s %s %uhz, got %c%u %u-channel %uhz instead\n", |