This commit is contained in:
Harrison Deng 2018-08-17 14:10:18 -05:00
parent 89e3abed63
commit 50bc2bfdea

View File

@ -74,9 +74,6 @@ public class PCMObtainer implements Observer, PCMSystem {
PCM[sid] /= Short.MAX_VALUE + 1f;
}
// Take down original buffer position so we don't need to sync again after...
int originalPos = buffer.position();
// Begin comparison
buffer.rewind();
if (intermediateBuffer.compareTo(buffer) != 0) {
@ -87,15 +84,12 @@ public class PCMObtainer implements Observer, PCMSystem {
intermediateBuffer.put(buffer);
intermediateBuffer.flip();
}
// Reset buffer to proper position.
buffer.position(originalPos);
}
private void bufferChanged() {
playingBuffer.position(0);
playingBuffer.rewind();
playingBuffer.put(intermediateBuffer);
playingBuffer.rewind();
synchronizeBufferWithPlayback();
}