Send serverflag0 with new packets as a test of sorts
This commit is contained in:
+14
@@ -507,6 +507,8 @@ public class LocalTeamspeakClientSocket
|
||||
|
||||
private class MicrophoneTask implements Runnable {
|
||||
private boolean wasSendingAudio = false;
|
||||
private byte sessionId = 1;
|
||||
private int flaggedPackets = 5;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -525,12 +527,17 @@ public class LocalTeamspeakClientSocket
|
||||
} else if (microphone.isReady()) {
|
||||
PacketBody0Voice voice = new PacketBody0Voice(getRole().getOut());
|
||||
|
||||
if (flaggedPackets > 0) {
|
||||
voice.setServerFlag0(sessionId);
|
||||
}
|
||||
|
||||
voice.setCodecType(microphone.getCodec());
|
||||
voice.setCodecData(microphone.provide());
|
||||
|
||||
try {
|
||||
writePacket(voice);
|
||||
|
||||
flaggedPackets --;
|
||||
wasSendingAudio = true;
|
||||
} catch (Exception e) {
|
||||
// All we are really concerned about here is a disconnection event, in which case the loop
|
||||
@@ -546,6 +553,13 @@ public class LocalTeamspeakClientSocket
|
||||
try {
|
||||
writePacket(voice);
|
||||
|
||||
// reset decoder flag
|
||||
flaggedPackets = 5;
|
||||
sessionId ++;
|
||||
|
||||
if (sessionId >= 8)
|
||||
sessionId = 1;
|
||||
|
||||
wasSendingAudio = false;
|
||||
} catch (Exception e) {
|
||||
// All we are really concerned about here is a disconnection event, in which case the loop
|
||||
|
||||
Reference in New Issue
Block a user