From bd363dc6a3b954ff28897b7cdd1f22222426354e Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 1 Dec 2022 10:41:27 -0500 Subject: [PATCH] MT#56008 fix G.722 ptime/multiplier confusion G.722 uses 4 bits per sample, not 8. This error was negated by the ptime incorrectly being adjusted by the clock rate multiplier. Change-Id: I125c897ee9cbdac29278be9b6451d82b48ff94c2 (cherry picked from commit e7b9ab282568d91c728195f15482d1d3adef7ac4) --- lib/codeclib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/codeclib.c b/lib/codeclib.c index 67f44fb39..0da0ce08f 100644 --- a/lib/codeclib.c +++ b/lib/codeclib.c @@ -211,7 +211,7 @@ static codec_def_t __codec_defs[] = { .default_channels = 1, .default_ptime = 20, .packetizer = packetizer_samplestream, - .bits_per_sample = 8, + .bits_per_sample = 4, .media_type = MT_AUDIO, .codec_type = &codec_type_avcodec, .silence_pattern = STR_CONST_INIT("\xfa"), @@ -1331,7 +1331,7 @@ int encoder_config_fmtp(encoder_t *enc, const codec_def_t *def, int bitrate, int enc->requested_format = *requested_format; enc->def = def; - enc->ptime = ptime / def->clockrate_mult; + enc->ptime = ptime; enc->bitrate = bitrate; err = def->codec_type->encoder_init ? def->codec_type->encoder_init(enc, fmtp, extra_opts) : 0;