Added while loop condition so it does not exit when getConnectionState returns Disconnected and stopOnDisconnect is false!

This commit is contained in:
kohlerpop1
2024-06-23 23:06:05 -04:00
parent 77c9cd6b52
commit d825803187

View File

@@ -93,7 +93,7 @@ public class RecorderListener implements LiveRecorder {
) {
byte[] dataBuffer = new byte[1024];
int bytesRead;
while (liveClient.getRoomInfo().getConnectionState() == ConnectionState.CONNECTED && (bytesRead = in.read(dataBuffer)) != -1) {
while ((!settings.isStopOnDisconnect() || liveClient.getRoomInfo().getConnectionState() == ConnectionState.CONNECTED) && (bytesRead = in.read(dataBuffer)) != -1) {
fos.write(dataBuffer, 0, bytesRead);
fos.flush();
}