#2652 DMR audio module checks voice messages for at least one CRC-valid audio frame before processing audio and purges any enqueued audio on voice header to prepare for the upcoming call (#2653)

Co-authored-by: denny <dennis.sheirer@gmail.com>
This commit is contained in:
Denny Sheirer
2026-11-15 01:47:46 -05:00
committed by GitHub
parent 5bce541631
commit 29a10edf03

View File

@@ -99,7 +99,7 @@ public class DMRAudioModule extends AmbeAudioModule implements IdentifierUpdateP
} }
/** /**
* Processes DMR AMBE audio frames and signalling messages. * Processes DMR AMBE audio frames and signaling messages.
*/ */
public void receive(IMessage message) public void receive(IMessage message)
{ {
@@ -166,7 +166,7 @@ public class DMRAudioModule extends AmbeAudioModule implements IdentifierUpdateP
//Queue or process audio frames. Note: audio frames are held/queued until encrypted state is established //Queue or process audio frames. Note: audio frames are held/queued until encrypted state is established
//before any audio is generated for the audio segment. //before any audio is generated for the audio segment.
if(message instanceof VoiceMessage voiceMessage) if(message instanceof VoiceMessage voiceMessage && voiceMessage.isValid())
{ {
if(mEncryptedCallStateEstablished && mEncryptedCall) if(mEncryptedCallStateEstablished && mEncryptedCall)
{ {
@@ -181,7 +181,12 @@ public class DMRAudioModule extends AmbeAudioModule implements IdentifierUpdateP
} }
} }
} }
else if(message instanceof Terminator) else if(message instanceof VoiceHeader voiceHeader && voiceHeader.isValid())
{
//Clear any queued audio frames received prior to the voice header
mQueuedAmbeFrames.clear();
}
else if(message instanceof Terminator terminator && terminator.isValid())
{ {
reset(); reset();
} }