Browse Source

MT#55283 use function pointer for DTX method

Change-Id: Ibfdf29f98d46bf1fc120159b6696c52ec0dfe2f1
pull/1945/head
Richard Fuchs 7 months ago
parent
commit
41a2dfbb55
1 changed files with 9 additions and 7 deletions
  1. +9
    -7
      daemon/codec.c

+ 9
- 7
daemon/codec.c View File

@ -3777,14 +3777,11 @@ static bool __dtx_drift_drop(struct dtx_buffer *dtxb, unsigned long ts,
return discard;
}
static bool __dtx_handle_drift(struct dtx_buffer *dtxb, unsigned long ts,
static bool (*__dtx_handle_drift)(struct dtx_buffer *dtxb, unsigned long ts,
int64_t tv_diff, int64_t ts_diff,
struct codec_ssrc_handler *ch)
{
if (rtpe_config.dtx_shift_us)
return __dtx_drift_shift(dtxb, ts, tv_diff, ts_diff, ch);
return __dtx_drift_drop(dtxb, ts, tv_diff, ts_diff, ch);
}
struct codec_ssrc_handler *ch);
static void __dtx_send_later(struct codec_timer *ct) {
struct dtx_buffer *dtxb = (void *) ct;
struct media_packet mp_copy = {0,};
@ -6472,6 +6469,11 @@ void codecs_init(void) {
if (tcc->preference)
have_codec_preferences = true;
}
if (rtpe_config.dtx_shift_us)
__dtx_handle_drift = __dtx_drift_shift;
else
__dtx_handle_drift = __dtx_drift_drop;
#endif
}
void codecs_cleanup(void) {


Loading…
Cancel
Save