Retry opening audio streams after all exceptions, not just IO failure.

master
Nekojimi 1 month ago
parent abd676fa49
commit a901163af3
  1. 4
      src/main/java/moe/nekojimi/chords/TrackPlayer.java

@ -26,7 +26,7 @@ public class TrackPlayer implements Closeable
private static final int DESIRED_BUFFER_SIZE = 3840 * 500;
private static final int MAX_READ_FAILS = 3;
private static final int RETRY_COUNT = 10;
private static final int RETRY_COUNT = 8;
private static final int RETRY_DELAY = 100;
private final CircularByteBuffer audioBuffer = new CircularByteBuffer(3840 * 1024);
@ -47,7 +47,7 @@ public class TrackPlayer implements Closeable
decodedFormat = AudioSendHandler.INPUT_FORMAT;
break; // it worked!
} catch (IOException ex)
} catch (Exception ex)
{
try
{

Loading…
Cancel
Save