Browse Source

TT#14008 DTX buffer PT change: take supp PTs into account

The PT tracker doesn't distinguish between audio/media types and
supplemental types, so in order not to break DTMF handling we must take
all combinations of primary (audio/media) types and supplemental types
as both input types and handler types into account.

Fix-up for 74075f6396
Fix-up for I57e1278e4fad157083d9526d4829f2940581687f

closes #1508
possibly also #1504

Change-Id: If7b242def2d35fbed14b11d204ea328b8bfe5d79
mr10.5.2
Richard Fuchs 4 years ago
parent
commit
a73cde8382
1 changed files with 27 additions and 4 deletions
  1. +27
    -4
      daemon/codec.c

+ 27
- 4
daemon/codec.c View File

@ -2983,10 +2983,33 @@ static void __dtx_send_later(struct codec_timer *ct) {
shutdown = true;
else if (dtxb->ct.next.tv_sec == 0)
shutdown = true;
else if (ps->ssrc_in[0]->tracker.most_len < 1)
shutdown = true;
else if (ps->ssrc_in[0]->tracker.most[0] != ch->handler->source_pt.payload_type)
shutdown = true;
else {
shutdown = true; // default if no most used PTs are known
for (int i = 0; i < ps->ssrc_in[0]->tracker.most_len; i++) {
unsigned char most_pt = ps->ssrc_in[0]->tracker.most[i];
shutdown = false;
// we are good if the most used PT is
// either us
if (ch->handler->source_pt.payload_type == most_pt)
break;
// or our input PT (which is the audio PT if we are supplemental)
if (ch->handler->input_handler && ch->handler->input_handler->source_pt.payload_type == most_pt)
break;
// looks like codec change, but...
shutdown = true;
// another possibility is that the most used PT is actually a supplemental type. check this,
// and if true move on to the next most used PT.
struct rtp_payload_type *pt = g_hash_table_lookup(ps->media->codecs.codecs, GUINT_TO_POINTER(most_pt));
if (pt && pt->codec_def && pt->codec_def->supplemental)
continue;
// all other cases: codec change
break;
}
}
if (shutdown) {
ilogs(dtx, LOG_DEBUG, "DTX buffer for %lx has been shut down", (unsigned long) dtxb->ssrc);


Loading…
Cancel
Save