From c00b2f92542f232cc6d8da90dcdcc562ee04e3ff Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 18 May 2011 17:02:18 -0700 Subject: Avoid looking in the buffer queue to find the frame size --- OpenAL32/Include/alSource.h | 1 + OpenAL32/alSource.c | 2 ++ 2 files changed, 3 insertions(+) (limited to 'OpenAL32') diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h index 806019e0..53d7f53c 100644 --- a/OpenAL32/Include/alSource.h +++ b/OpenAL32/Include/alSource.h @@ -87,6 +87,7 @@ typedef struct ALsource ALint lSourceType; ALuint NumChannels; + ALuint SampleSize; /* HRTF info */ ALfloat HrtfHistory[MAXCHANNELS][HRTF_LENGTH]; diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 11f472c2..6c6bf44b 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -567,6 +567,7 @@ AL_API ALvoid AL_APIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue) Source->BuffersInQueue = 1; Source->NumChannels = ChannelsFromFmt(buffer->FmtChannels); + Source->SampleSize = BytesFromFmt(buffer->FmtType); if(buffer->FmtChannels == FmtMono) Source->Update = CalcSourceParams; else @@ -1613,6 +1614,7 @@ AL_API ALvoid AL_APIENTRY alSourceQueueBuffers(ALuint source, ALsizei n, const A BufferFmt = buffer; Source->NumChannels = ChannelsFromFmt(buffer->FmtChannels); + Source->SampleSize = BytesFromFmt(buffer->FmtType); if(buffer->FmtChannels == FmtMono) Source->Update = CalcSourceParams; else -- cgit v1.2.3