diff options
author | Chris Robinson <[email protected]> | 2018-01-21 23:35:28 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-01-21 23:35:28 -0800 |
commit | 5f3ae527c92fa1fda0ea87be9629db2c320831ec (patch) | |
tree | 52a8a28507c408b20c1355f6446f592b8c0f5dc2 /OpenAL32/alSource.c | |
parent | db13af1935f969bb579fca9d79c6600d91c0fe32 (diff) |
More cleanup for buffer loading
Don't bother with unnecessary and unused converters, and remove some
unsupported queries.
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r-- | OpenAL32/alSource.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 5f21b991..24f48895 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -2897,7 +2897,7 @@ AL_API ALvoid AL_APIENTRY alSourceQueueBuffers(ALuint src, ALsizei nb, const ALu if(BufferFmt == NULL) BufferFmt = buffer; else if(BufferFmt->Frequency != buffer->Frequency || - BufferFmt->OriginalChannels != buffer->OriginalChannels || + BufferFmt->FmtChannels != buffer->FmtChannels || BufferFmt->OriginalType != buffer->OriginalType) { WriteUnlock(&source->queue_lock); @@ -3493,8 +3493,8 @@ static ALdouble GetSourceOffset(ALsource *Source, ALenum name, ALCcontext *conte } else { - ALuint FrameSize = FrameSizeFromUserFmt(BufferFmt->OriginalChannels, - BufferFmt->OriginalType); + ALuint FrameSize = FrameSizeFromFmt(BufferFmt->FmtChannels, + BufferFmt->FmtType); offset = (ALdouble)(readPos * FrameSize); } break; @@ -3593,18 +3593,17 @@ static ALboolean GetSampleOffset(ALsource *Source, ALuint *offset, ALsizei *frac if(BufferFmt->OriginalType == UserFmtIMA4) { ALsizei align = (BufferFmt->OriginalAlign-1)/2 + 4; - *offset /= align * ChannelsFromUserFmt(BufferFmt->OriginalChannels); + *offset /= align * ChannelsFromFmt(BufferFmt->FmtChannels); *offset *= BufferFmt->OriginalAlign; } else if(BufferFmt->OriginalType == UserFmtMSADPCM) { ALsizei align = (BufferFmt->OriginalAlign-2)/2 + 7; - *offset /= align * ChannelsFromUserFmt(BufferFmt->OriginalChannels); + *offset /= align * ChannelsFromFmt(BufferFmt->FmtChannels); *offset *= BufferFmt->OriginalAlign; } else - *offset /= FrameSizeFromUserFmt(BufferFmt->OriginalChannels, - BufferFmt->OriginalType); + *offset /= FrameSizeFromFmt(BufferFmt->FmtChannels, BufferFmt->FmtType); *frac = 0; break; |