MT#55283 add __dtx_should_do helper function

Change-Id: Id2f51bb5b22b2b68edf542634b60eaf6f1d92eea
mr13.3
Richard Fuchs 2 months ago
parent 3421dd6407
commit 0d06b788b2

@ -3266,6 +3266,18 @@ static void __buffer_delay_seq(struct delay_buffer *dbuf, struct media_packet *m
dframe->seq_adj += seq_adj;
}
static bool __dtx_should_do(struct codec_ssrc_handler *ch) {
if (!ch)
return false;
if (!ch->decoder)
return false;
if (!decoder_has_dtx(ch->decoder))
return false;
if (!rtpe_config.dtx_delay)
return false;
return true;
}
// consumes `packet` if buffered (returns true)
// `packet` can be NULL (discarded packet for seq tracking)
static bool __buffer_dtx(struct dtx_buffer *dtxb, struct codec_ssrc_handler *decoder_handler,
@ -3956,12 +3968,7 @@ static void __delay_buffer_free(struct delay_buffer *dbuf) {
mutex_destroy(&dbuf->lock);
}
static void __dtx_setup(struct codec_ssrc_handler *ch) {
if (!ch->decoder)
return;
if (!decoder_has_dtx(ch->decoder))
return;
if (!rtpe_config.dtx_delay)
if (!__dtx_should_do(ch))
return;
struct dtx_buffer *dtx = ch->dtx_buffer;

Loading…
Cancel
Save