switched to checking buffer position to make sure its legal
This commit is contained in:
parent
3a871e8d99
commit
98e2932f49
@ -100,7 +100,7 @@ public class Visualizer extends Widget implements Disposable {
|
|||||||
int pos = (int) ((alGetSourcef(sourceID, AL11.AL_SAMPLE_OFFSET))-(mm.getReadWindowSize()*mm.getChannelCount()));
|
int pos = (int) ((alGetSourcef(sourceID, AL11.AL_SAMPLE_OFFSET))-(mm.getReadWindowSize()*mm.getChannelCount()));
|
||||||
try {
|
try {
|
||||||
readWindowIndex = mm.getPlaybackIndexPosition()-1;
|
readWindowIndex = mm.getPlaybackIndexPosition()-1;
|
||||||
buffer.position(pos);
|
buffer.position(Math.max(pos, 0));
|
||||||
} catch (IllegalArgumentException iae) {
|
} catch (IllegalArgumentException iae) {
|
||||||
buffer.position(0);
|
buffer.position(0);
|
||||||
Gdx.app.error("BufferPosition", iae + " position was " + pos);
|
Gdx.app.error("BufferPosition", iae + " position was " + pos);
|
||||||
|
Loading…
Reference in New Issue
Block a user