summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/ALu.c1
-rw-r--r--OpenAL32/Include/alSource.h1
-rw-r--r--OpenAL32/alSource.c9
3 files changed, 1 insertions, 10 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index bd2b086b..f49b7807 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -920,7 +920,6 @@ ALvoid aluMixData(ALCcontext *ALContext,ALvoid *buffer,ALsizei size,ALenum forma
ALSource->inuse = AL_TRUE;
ALSource->play = AL_TRUE;
ALSource->BuffersPlayed = 0;
- ALSource->BufferPosition = 0;
ALSource->lBytesPlayed = 0;
BufferListItem = ALSource->queue;
while(BufferListItem != NULL)
diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h
index 01c06b91..ffdd9f10 100644
--- a/OpenAL32/Include/alSource.h
+++ b/OpenAL32/Include/alSource.h
@@ -62,7 +62,6 @@ typedef struct ALsource
ALuint TotalBufferDataSize; // Total amount of data contained in the buffers queued for this source
ALuint BuffersPlayed; // Number of buffers played on this loop
- ALuint BufferPosition; // Read position in audio data of current buffer
ALfilter DirectFilter;
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c
index 61991b2e..799c18a9 100644
--- a/OpenAL32/alSource.c
+++ b/OpenAL32/alSource.c
@@ -1411,7 +1411,6 @@ ALAPI ALvoid ALAPIENTRY alSourcePlayv(ALsizei n, const ALuint *pSourceList)
pSource->position = 0;
pSource->position_fraction = 0;
pSource->BuffersPlayed = 0;
- pSource->BufferPosition = 0;
pSource->lBytesPlayed = 0;
pSource->ulBufferID = pSource->queue->buffer;
@@ -1927,10 +1926,7 @@ ALAPI ALvoid ALAPIENTRY alSourceUnqueueBuffers( ALuint source, ALsizei n, ALuint
}
if((ALuint)n > ALSource->BuffersPlayed)
- {
ALSource->BuffersPlayed = 0;
- ALSource->BufferPosition = 0;
- }
else
ALSource->BuffersPlayed -= n;
}
@@ -2150,14 +2146,11 @@ static void ApplyOffset(ALsource *pSource, ALboolean bUpdateContext)
// Set Current Buffer ID
pSource->ulBufferID = pBufferList->buffer;
- // Set current position in this buffer
- pSource->BufferPosition = lByteOffset - lTotalBufferSize;
-
// Set Total Bytes Played to Offset
pSource->lBytesPlayed = lByteOffset;
// SW Mixer Positions are in Samples
- pSource->position = pSource->BufferPosition /
+ pSource->position = (lByteOffset - lTotalBufferSize) /
aluBytesFromFormat(pBuffer->format) /
aluChannelsFromFormat(pBuffer->format);
}