aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/solaris.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/solaris.cpp
parentb49e8985a47f384dfde0ddd04d97426e3c37f480 (diff)
Use inline methods for the device format sizes
Diffstat (limited to 'Alc/backends/solaris.cpp')
-rw-r--r--Alc/backends/solaris.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/Alc/backends/solaris.cpp b/Alc/backends/solaris.cpp
index 941ca015..8871fb93 100644
--- a/Alc/backends/solaris.cpp
+++ b/Alc/backends/solaris.cpp
@@ -114,7 +114,7 @@ static int ALCsolarisBackend_mixerProc(ALCsolarisBackend *self)
SetRTPriority();
althrd_setname(MIXER_THREAD_NAME);
- frame_size = FrameSizeFromDevFmt(device->FmtChans, device->FmtType, device->mAmbiOrder);
+ frame_size = device->frameSizeFromFmt();
ALCsolarisBackend_lock(self);
while(!self->mKillNow.load(std::memory_order_acquire) &&
@@ -203,7 +203,7 @@ static ALCboolean ALCsolarisBackend_reset(ALCsolarisBackend *self)
if(device->FmtChans != DevFmtMono)
device->FmtChans = DevFmtStereo;
- numChannels = ChannelsFromDevFmt(device->FmtChans, device->mAmbiOrder);
+ numChannels = device->channelsFromFmt();
info.play.channels = numChannels;
switch(device->FmtType)
@@ -228,7 +228,7 @@ static ALCboolean ALCsolarisBackend_reset(ALCsolarisBackend *self)
break;
}
- frameSize = numChannels * BytesFromDevFmt(device->FmtType);
+ frameSize = numChannels * device->bytesFromFmt();
info.play.buffer_size = device->UpdateSize*device->NumUpdates * frameSize;
if(ioctl(self->fd, AUDIO_SETINFO, &info) < 0)
@@ -237,9 +237,10 @@ static ALCboolean ALCsolarisBackend_reset(ALCsolarisBackend *self)
return ALC_FALSE;
}
- if(ChannelsFromDevFmt(device->FmtChans, device->mAmbiOrder) != (ALsizei)info.play.channels)
+ if(device->channelsFromFmt() != (ALsizei)info.play.channels)
{
- ERR("Failed to set %s, got %u channels instead\n", DevFmtChannelsString(device->FmtChans), info.play.channels);
+ ERR("Failed to set %s, got %u channels instead\n", DevFmtChannelsString(device->FmtChans),
+ info.play.channels);
return ALC_FALSE;
}
@@ -259,9 +260,7 @@ static ALCboolean ALCsolarisBackend_reset(ALCsolarisBackend *self)
SetDefaultChannelOrder(device);
free(self->mix_data);
- self->data_size = device->UpdateSize * FrameSizeFromDevFmt(
- device->FmtChans, device->FmtType, device->mAmbiOrder
- );
+ self->data_size = device->UpdateSize * device->frameSizeFromFmt();
self->mix_data = static_cast<ALubyte*>(calloc(1, self->data_size));
return ALC_TRUE;