Throw exception if seeking a non-seekable audio stream

experimental
shadowislord 10 years ago
parent 2ca1305ff5
commit 595eb56f9b
  1. 3
      jme3-core/src/main/java/com/jme3/audio/AudioStream.java

@ -97,6 +97,7 @@ public class AudioStream extends AudioData implements Closeable {
} }
return totalRead; return totalRead;
} catch (IOException ex) { } catch (IOException ex) {
ex.printStackTrace();
eof = true; eof = true;
return -1; return -1;
} }
@ -196,7 +197,7 @@ public class AudioStream extends AudioData implements Closeable {
((SeekableStream) in).setTime(time); ((SeekableStream) in).setTime(time);
eof = false; eof = false;
} else { } else {
logger.log(Level.WARNING, throw new IllegalStateException(
"Cannot use setTime on a stream that " "Cannot use setTime on a stream that "
+ "is not seekable. You must load the file " + "is not seekable. You must load the file "
+ "with the streamCache option set to true"); + "with the streamCache option set to true");

Loading…
Cancel
Save