Use the source's offset type to determine if there's an offset
This commit is contained in:
parent
182c0cb61a
commit
7dac02148b
@ -1604,7 +1604,7 @@ void ALCcontext_ProcessUpdates(ALCcontext *context)
|
|||||||
ALenum new_state;
|
ALenum new_state;
|
||||||
|
|
||||||
if((Source->state == AL_PLAYING || Source->state == AL_PAUSED) &&
|
if((Source->state == AL_PLAYING || Source->state == AL_PAUSED) &&
|
||||||
Source->Offset >= 0.0)
|
Source->OffsetType != AL_NONE)
|
||||||
{
|
{
|
||||||
WriteLock(&Source->queue_lock);
|
WriteLock(&Source->queue_lock);
|
||||||
ApplyOffset(Source);
|
ApplyOffset(Source);
|
||||||
|
@ -2544,7 +2544,8 @@ static ALvoid InitSourceParams(ALsource *Source)
|
|||||||
Source->state = AL_INITIAL;
|
Source->state = AL_INITIAL;
|
||||||
Source->new_state = AL_NONE;
|
Source->new_state = AL_NONE;
|
||||||
Source->SourceType = AL_UNDETERMINED;
|
Source->SourceType = AL_UNDETERMINED;
|
||||||
Source->Offset = -1.0;
|
Source->OffsetType = AL_NONE;
|
||||||
|
Source->Offset = 0.0;
|
||||||
|
|
||||||
ATOMIC_INIT(&Source->queue, NULL);
|
ATOMIC_INIT(&Source->queue, NULL);
|
||||||
ATOMIC_INIT(&Source->current_buffer, NULL);
|
ATOMIC_INIT(&Source->current_buffer, NULL);
|
||||||
@ -2608,7 +2609,7 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if an Offset has been set
|
// Check if an Offset has been set
|
||||||
if(Source->Offset >= 0.0)
|
if(Source->OffsetType != AL_NONE)
|
||||||
{
|
{
|
||||||
ApplyOffset(Source);
|
ApplyOffset(Source);
|
||||||
/* discontinuity = AL_TRUE;??? */
|
/* discontinuity = AL_TRUE;??? */
|
||||||
@ -2680,7 +2681,8 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state)
|
|||||||
Source->state = AL_STOPPED;
|
Source->state = AL_STOPPED;
|
||||||
ATOMIC_STORE(&Source->current_buffer, NULL);
|
ATOMIC_STORE(&Source->current_buffer, NULL);
|
||||||
}
|
}
|
||||||
Source->Offset = -1.0;
|
Source->OffsetType = AL_NONE;
|
||||||
|
Source->Offset = 0.0;
|
||||||
}
|
}
|
||||||
else if(state == AL_INITIAL)
|
else if(state == AL_INITIAL)
|
||||||
{
|
{
|
||||||
@ -2691,7 +2693,8 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state)
|
|||||||
Source->position_fraction = 0;
|
Source->position_fraction = 0;
|
||||||
ATOMIC_STORE(&Source->current_buffer, ATOMIC_LOAD(&Source->queue));
|
ATOMIC_STORE(&Source->current_buffer, ATOMIC_LOAD(&Source->queue));
|
||||||
}
|
}
|
||||||
Source->Offset = -1.0;
|
Source->OffsetType = AL_NONE;
|
||||||
|
Source->Offset = 0.0;
|
||||||
}
|
}
|
||||||
WriteUnlock(&Source->queue_lock);
|
WriteUnlock(&Source->queue_lock);
|
||||||
}
|
}
|
||||||
@ -2942,7 +2945,8 @@ static ALboolean GetSampleOffset(ALsource *Source, ALuint *offset, ALuint *frac)
|
|||||||
}
|
}
|
||||||
if(!Buffer)
|
if(!Buffer)
|
||||||
{
|
{
|
||||||
Source->Offset = -1.0;
|
Source->OffsetType = AL_NONE;
|
||||||
|
Source->Offset = 0.0;
|
||||||
return AL_FALSE;
|
return AL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2980,7 +2984,8 @@ static ALboolean GetSampleOffset(ALsource *Source, ALuint *offset, ALuint *frac)
|
|||||||
*frac = (ALuint)mind(dblfrac*FRACTIONONE, FRACTIONONE-1.0);
|
*frac = (ALuint)mind(dblfrac*FRACTIONONE, FRACTIONONE-1.0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Source->Offset = -1.0;
|
Source->OffsetType = AL_NONE;
|
||||||
|
Source->Offset = 0.0;
|
||||||
|
|
||||||
return AL_TRUE;
|
return AL_TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user