poss. fix for tailing audio artifact p25p2

This commit is contained in:
Max 2022-07-03 16:13:44 -04:00
parent 1e7b8b43a2
commit dd830a1463
1 changed files with 17 additions and 4 deletions

View File

@ -386,6 +386,15 @@ int p25p2_tdma::handle_frame(void)
return rc; return rc;
} }
static inline bool null_codeword(const uint8_t*bp) {
static const int l = 36; // dibits per voice frame
for (int i=0; i<l; i++) {
if (bp[i])
return false;
}
return true;
}
/* returns true if in sync and slot matches current active slot d_slotid */ /* returns true if in sync and slot matches current active slot d_slotid */
int p25p2_tdma::handle_packet(const uint8_t dibits[]) int p25p2_tdma::handle_packet(const uint8_t dibits[])
{ {
@ -410,11 +419,15 @@ int p25p2_tdma::handle_packet(const uint8_t dibits[])
track_vb(burst_type); track_vb(burst_type);
handle_4V2V_ess(&xored_burst[84]); handle_4V2V_ess(&xored_burst[84]);
if ( !encrypted() ) { if ( !encrypted() ) {
handle_voice_frame(&xored_burst[11]); if(!null_codeword(&burstp[11]))
handle_voice_frame(&xored_burst[48]); handle_voice_frame(&xored_burst[11]);
if(!null_codeword(&burstp[48]))
handle_voice_frame(&xored_burst[48]);
if (burst_type == 0) { if (burst_type == 0) {
handle_voice_frame(&xored_burst[96]); if(!null_codeword(&burstp[96]))
handle_voice_frame(&xored_burst[133]); handle_voice_frame(&xored_burst[96]);
if(!null_codeword(&burstp[133]))
handle_voice_frame(&xored_burst[133]);
} }
} }
return -1; return -1;