Skip to content

Commit 0bb01ac

Browse files
committed
Fix an oversight when reading from the decoder
1 parent aae6913 commit 0bb01ac

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lime/_internal/backend/native/NativeAudioSource.hx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ class NativeAudioSource
988988
{
989989
if (decoder.eof || currentPCM >= loopPoints[1])
990990
{
991-
if (streamEnded = loops <= streamLoops || !decoder.seek(loopPoints[0])) return 0;
991+
if (streamEnded = loops <= streamLoops || !decoder.seek(currentPCM = loopPoints[0])) return 0;
992992
streamLoops++;
993993
}
994994

@@ -1098,7 +1098,10 @@ class NativeAudioSource
10981098

10991099
streamEnded = false;
11001100
queuedBuffers = filledBuffers = streamLoops = nextBuffer = 0;
1101-
decoder.seek(sample);
1101+
1102+
if (sample == 0) decoder.rewind();
1103+
else decoder.seek(sample);
1104+
11021105
fillBuffers(n);
11031106
queueBuffers();
11041107
}

0 commit comments

Comments
 (0)