aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alSource.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-08-21 00:35:37 -0700
committerChris Robinson <[email protected]>2011-08-21 00:35:37 -0700
commita97211b5724a4d31fb9dff93a62d941d55cbd041 (patch)
tree1e457caefdd3bf8e471f0a33b0f56aa4b3d7522c /OpenAL32/alSource.c
parentf196a9fc67551aef43f75c3e36f3031170a03dac (diff)
Use -1 to mark an invalid source offset instead of 0
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r--OpenAL32/alSource.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index 113970e6..8fea0f91 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -1778,6 +1778,7 @@ static ALvoid InitSourceParams(ALsource *Source)
Source->state = AL_INITIAL;
Source->new_state = AL_NONE;
Source->lSourceType = AL_UNDETERMINED;
+ Source->lOffset = -1;
Source->NeedsUpdate = AL_TRUE;
@@ -1844,7 +1845,7 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state)
Source->state = AL_PLAYING;
// Check if an Offset has been set
- if(Source->lOffset)
+ if(Source->lOffset != -1)
ApplyOffset(Source);
for(j = 0;j < Context->ActiveSourceCount;j++)
@@ -1873,7 +1874,7 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state)
Source->HrtfMoving = AL_FALSE;
Source->HrtfCounter = 0;
}
- Source->lOffset = 0;
+ Source->lOffset = -1;
}
else if(state == AL_INITIAL)
{
@@ -1888,7 +1889,7 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state)
Source->HrtfMoving = AL_FALSE;
Source->HrtfCounter = 0;
}
- Source->lOffset = 0;
+ Source->lOffset = -1;
}
}
@@ -2096,7 +2097,7 @@ static ALint GetByteOffset(ALsource *Source)
if(!Buffer)
{
- Source->lOffset = 0;
+ Source->lOffset = -1;
return -1;
}
@@ -2129,7 +2130,7 @@ static ALint GetByteOffset(ALsource *Source)
break;
}
// Clear Offset
- Source->lOffset = 0;
+ Source->lOffset = -1;
return ByteOffset;
}