Store loop points as uncompressed frame offsets in the source when a buffer is attached
This commit is contained in:
parent
0ce138341c
commit
5d579dd1a8
@ -78,6 +78,10 @@ typedef struct ALsource
|
|||||||
ALint lOffset;
|
ALint lOffset;
|
||||||
ALint lOffsetType;
|
ALint lOffsetType;
|
||||||
|
|
||||||
|
// Only valid for static sources types
|
||||||
|
ALint LoopStart;
|
||||||
|
ALint LoopEnd;
|
||||||
|
|
||||||
// Source Type (Static, Streaming, or Undetermined)
|
// Source Type (Static, Streaming, or Undetermined)
|
||||||
ALint lSourceType;
|
ALint lSourceType;
|
||||||
|
|
||||||
|
@ -554,6 +554,8 @@ AL_API ALvoid AL_APIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue)
|
|||||||
// Add the buffer to the queue (as long as it is NOT the NULL buffer)
|
// Add the buffer to the queue (as long as it is NOT the NULL buffer)
|
||||||
if(lValue != 0)
|
if(lValue != 0)
|
||||||
{
|
{
|
||||||
|
ALuint channels;
|
||||||
|
|
||||||
// Source is now in STATIC mode
|
// Source is now in STATIC mode
|
||||||
Source->lSourceType = AL_STATIC;
|
Source->lSourceType = AL_STATIC;
|
||||||
|
|
||||||
@ -565,6 +567,14 @@ AL_API ALvoid AL_APIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue)
|
|||||||
Source->queue = BufferListItem;
|
Source->queue = BufferListItem;
|
||||||
Source->BuffersInQueue = 1;
|
Source->BuffersInQueue = 1;
|
||||||
|
|
||||||
|
channels = aluChannelsFromFormat(buffer->format);
|
||||||
|
Source->LoopStart = FramesFromBytes(buffer->LoopStart,
|
||||||
|
buffer->eOriginalFormat,
|
||||||
|
channels);
|
||||||
|
Source->LoopEnd = FramesFromBytes(buffer->LoopEnd,
|
||||||
|
buffer->eOriginalFormat,
|
||||||
|
channels);
|
||||||
|
|
||||||
// Increment reference counter for buffer
|
// Increment reference counter for buffer
|
||||||
buffer->refcount++;
|
buffer->refcount++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user