From e7b9ab282568d91c728195f15482d1d3adef7ac4 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 --- lib/codeclib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/codeclib.c b/lib/codeclib.c index 71be917ec..594b5f9d2 100644 --- a/lib/codeclib.c +++ b/lib/codeclib.c @@ -264,7 +264,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"), @@ -1442,7 +1442,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 = fraction_div(ptime, &enc->clockrate_fact); + enc->ptime = ptime; enc->bitrate = bitrate; err = "failed to parse \"fmtp\"";