aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/opensl.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-12-19 05:57:36 -0800
committerChris Robinson <[email protected]>2018-12-19 05:57:36 -0800
commit0214a1102497003df07f354adc1e77d2b3185953 (patch)
tree5b39e70dc19752eb620767991a0bddf68ee22faf /Alc/backends/opensl.cpp
parentb49e8985a47f384dfde0ddd04d97426e3c37f480 (diff)
Use inline methods for the device format sizes
Diffstat (limited to 'Alc/backends/opensl.cpp')
-rw-r--r--Alc/backends/opensl.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/Alc/backends/opensl.cpp b/Alc/backends/opensl.cpp
index c2acda3a..78212791 100644
--- a/Alc/backends/opensl.cpp
+++ b/Alc/backends/opensl.cpp
@@ -464,7 +464,7 @@ static ALCboolean ALCopenslPlayback_reset(ALCopenslPlayback *self)
device->FmtType = DevFmtShort;
SetDefaultWFXChannelOrder(device);
- self->mFrameSize = FrameSizeFromDevFmt(device->FmtChans, device->FmtType, device->mAmbiOrder);
+ self->mFrameSize = device->frameSizeFromFmt();
loc_bufq.locatorType = SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE;
@@ -473,9 +473,9 @@ static ALCboolean ALCopenslPlayback_reset(ALCopenslPlayback *self)
#ifdef SL_DATAFORMAT_PCM_EX
SLDataFormat_PCM_EX format_pcm;
format_pcm.formatType = SL_DATAFORMAT_PCM_EX;
- format_pcm.numChannels = ChannelsFromDevFmt(device->FmtChans, device->mAmbiOrder);
+ format_pcm.numChannels = device->channelsFromFmt();
format_pcm.sampleRate = device->Frequency * 1000;
- format_pcm.bitsPerSample = BytesFromDevFmt(device->FmtType) * 8;
+ format_pcm.bitsPerSample = device->bytesFromFmt() * 8;
format_pcm.containerSize = format_pcm.bitsPerSample;
format_pcm.channelMask = GetChannelMask(device->FmtChans);
format_pcm.endianness = IS_LITTLE_ENDIAN ? SL_BYTEORDER_LITTLEENDIAN :
@@ -484,9 +484,9 @@ static ALCboolean ALCopenslPlayback_reset(ALCopenslPlayback *self)
#else
SLDataFormat_PCM format_pcm;
format_pcm.formatType = SL_DATAFORMAT_PCM;
- format_pcm.numChannels = ChannelsFromDevFmt(device->FmtChans, device->mAmbiOrder);
+ format_pcm.numChannels = device->channelsFromFmt();
format_pcm.samplesPerSec = device->Frequency * 1000;
- format_pcm.bitsPerSample = BytesFromDevFmt(device->FmtType) * 8;
+ format_pcm.bitsPerSample = device->bytesFromFmt() * 8;
format_pcm.containerSize = format_pcm.bitsPerSample;
format_pcm.channelMask = GetChannelMask(device->FmtChans);
format_pcm.endianness = IS_LITTLE_ENDIAN ? SL_BYTEORDER_LITTLEENDIAN :
@@ -755,7 +755,7 @@ static ALCenum ALCopenslCapture_open(ALCopenslCapture *self, const ALCchar *name
device->UpdateSize = update_len;
device->NumUpdates = (length+update_len-1) / update_len;
- self->mFrameSize = FrameSizeFromDevFmt(device->FmtChans, device->FmtType, device->mAmbiOrder);
+ self->mFrameSize = device->frameSizeFromFmt();
}
loc_dev.locatorType = SL_DATALOCATOR_IODEVICE;
loc_dev.deviceType = SL_IODEVICE_AUDIOINPUT;
@@ -771,9 +771,9 @@ static ALCenum ALCopenslCapture_open(ALCopenslCapture *self, const ALCchar *name
#ifdef SL_DATAFORMAT_PCM_EX
SLDataFormat_PCM_EX format_pcm;
format_pcm.formatType = SL_DATAFORMAT_PCM_EX;
- format_pcm.numChannels = ChannelsFromDevFmt(device->FmtChans, device->mAmbiOrder);
+ format_pcm.numChannels = device->channelsFromFmt();
format_pcm.sampleRate = device->Frequency * 1000;
- format_pcm.bitsPerSample = BytesFromDevFmt(device->FmtType) * 8;
+ format_pcm.bitsPerSample = device->bytesFromFmt() * 8;
format_pcm.containerSize = format_pcm.bitsPerSample;
format_pcm.channelMask = GetChannelMask(device->FmtChans);
format_pcm.endianness = IS_LITTLE_ENDIAN ? SL_BYTEORDER_LITTLEENDIAN :
@@ -782,9 +782,9 @@ static ALCenum ALCopenslCapture_open(ALCopenslCapture *self, const ALCchar *name
#else
SLDataFormat_PCM format_pcm;
format_pcm.formatType = SL_DATAFORMAT_PCM;
- format_pcm.numChannels = ChannelsFromDevFmt(device->FmtChans, device->mAmbiOrder);
+ format_pcm.numChannels = device->channelsFromFmt();
format_pcm.samplesPerSec = device->Frequency * 1000;
- format_pcm.bitsPerSample = BytesFromDevFmt(device->FmtType) * 8;
+ format_pcm.bitsPerSample = device->bytesFromFmt() * 8;
format_pcm.containerSize = format_pcm.bitsPerSample;
format_pcm.channelMask = GetChannelMask(device->FmtChans);
format_pcm.endianness = IS_LITTLE_ENDIAN ? SL_BYTEORDER_LITTLEENDIAN :