Skip to content

Commit

Permalink
Compiles clean without AL_EXT_buffer_offset support.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jan 20, 2005
1 parent b926acf commit ca7f3d2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions osx/alSource.c
Expand Up @@ -411,8 +411,6 @@ ALAPI ALvoid ALAPIENTRY alSource3f (ALuint source, ALenum pname, ALfloat v1, ALf
ALAPI ALvoid ALAPIENTRY alSourcei (ALuint source, ALenum pname, ALint value)
{
ALsource *src;
ALbuffer *buf;
ALuint tmp;
register ALboolean needsRecalc = AL_FALSE;
register ALcontext *ctx = __alGrabContextAndGetSource(source, &src);

Expand Down Expand Up @@ -465,7 +463,8 @@ ALAPI ALvoid ALAPIENTRY alSourcei (ALuint source, ALenum pname, ALint value)

#if SUPPORTS_AL_EXT_BUFFER_OFFSET
case AL_BUFFER_OFFSET_EXT:
buf = __alGetPlayingBuffer(ctx, src);
{
ALbuffer *buf = __alGetPlayingBuffer(ctx, src);
if (buf == NULL)
__alSetError(AL_ILLEGAL_COMMAND);
else
Expand All @@ -474,11 +473,12 @@ ALAPI ALvoid ALAPIENTRY alSourcei (ALuint source, ALenum pname, ALint value)
__alSetError(AL_INVALID_VALUE);
else
{
tmp = buf->channels * (buf->bits / 8);
ALuint tmp = buf->channels * (buf->bits / 8);
src->bufferReadIndex = value / tmp;
} // else
} // else
break;
} // case
#endif

default:
Expand Down Expand Up @@ -595,8 +595,6 @@ ALAPI ALvoid ALAPIENTRY alGetSourcefv (ALuint source, ALenum pname, ALfloat *val
ALAPI ALvoid ALAPIENTRY alGetSourcei (ALuint source, ALenum pname, ALint *value)
{
ALsource *src;
ALbuffer *buf;
ALuint tmp;
register ALcontext *ctx = __alGrabContextAndGetSource(source, &src);

if (ctx != NULL)
Expand Down Expand Up @@ -634,18 +632,20 @@ ALAPI ALvoid ALAPIENTRY alGetSourcei (ALuint source, ALenum pname, ALint *value)

#if SUPPORTS_AL_EXT_BUFFER_OFFSET
case AL_BUFFER_OFFSET_EXT:
buf = __alGetPlayingBuffer(ctx, src);
{
ALbuffer *buf = __alGetPlayingBuffer(ctx, src);
if (buf == NULL)
{
__alSetError(AL_ILLEGAL_COMMAND);
*value = -1;
} // if
else
{
tmp = buf->channels * (buf->bits / 8);
ALuint tmp = buf->channels * (buf->bits / 8);
*value = src->bufferReadIndex * tmp;
} // else
break;
} // case
#endif

default:
Expand Down

0 comments on commit ca7f3d2

Please sign in to comment.