Skip to content
Permalink
Browse files

Clear audio blocks before proceeding

  • Loading branch information
bear101 committed Jan 12, 2020
1 parent 3818cfd commit 7efcafc1693ebdffee47d779db38115f5e018a27
Showing with 9 additions and 4 deletions.
  1. +9 −4 Library/TeamTalkJNI/test/dk/bearware/TeamTalkTestCase.java
@@ -1243,7 +1243,7 @@ public void test_MuxedAudioBlock() throws IOException {
initSound(rxclient);
login(rxclient, NICKNAME, USERNAME, PASSWORD);

Channel chan = buildDefaultChannel(rxclient, "Opus", Codec.OPUS_CODEC);
Channel chan = buildDefaultChannel(rxclient, "Opus - Mux initial", Codec.OPUS_CODEC);
chan.audiocodec.opus.nChannels = 2;
chan.audiocodec.opus.nApplication = OpusConstants.OPUS_APPLICATION_AUDIO;
chan.audiocodec.opus.bDTX = false;
@@ -1335,10 +1335,12 @@ public void test_MuxedAudioBlock() throws IOException {
} while (receiveSamples > 0);
// 12 sec

assertTrue("disable aud cb", rxclient.enableAudioBlockEvent(Constants.TT_MUXED_USERID, StreamType.STREAMTYPE_VOICE, false));

assertTrue("leave opus", waitCmdSuccess(rxclient, rxclient.doLeaveChannel(), DEF_WAIT));

assertTrue("disable aud cb and remove pending audio blocks", rxclient.enableAudioBlockEvent(Constants.TT_MUXED_USERID, StreamType.STREAMTYPE_VOICE, false));

assertTrue("cleared audio blocks", rxclient.acquireUserAudioBlock(StreamType.STREAMTYPE_VOICE, Constants.TT_MUXED_USERID) == null);

assertTrue("enable aud cb again", rxclient.enableAudioBlockEvent(Constants.TT_MUXED_USERID, StreamType.STREAMTYPE_VOICE, true));

assertFalse("no audio mux when out of channel", waitForEvent(rxclient, ClientEvent.CLIENTEVENT_USER_AUDIOBLOCK, 500));
@@ -1397,8 +1399,11 @@ public void test_MuxedAudioBlock() throws IOException {

assertFalse("no audio mux when out of channel", waitForEvent(rxclient, ClientEvent.CLIENTEVENT_USER_AUDIOBLOCK, 500));

// drain any remaining audio blocks
while(rxclient.acquireUserAudioBlock(StreamType.STREAMTYPE_VOICE, Constants.TT_MUXED_USERID) != null);

// ensure 'muxfileoutput.wav' will continue writing again
chan = buildDefaultChannel(rxclient, "Opus", Codec.OPUS_CODEC);
chan = buildDefaultChannel(rxclient, "Opus - Muxed secondary", Codec.OPUS_CODEC);
chan.audiocodec.opus.nChannels = 2;
chan.audiocodec.opus.nApplication = OpusConstants.OPUS_APPLICATION_AUDIO;
chan.audiocodec.opus.bDTX = false;

0 comments on commit 7efcafc

Please sign in to comment.
You can’t perform that action at this time.