Browse Source

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 e7b9ab2825)
pull/1736/head
Richard Fuchs 3 years ago
parent
commit
bd363dc6a3
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      lib/codeclib.c

+ 2
- 2
lib/codeclib.c View File

@ -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;


Loading…
Cancel
Save