Merge pull request #1798 in FS/freeswitch from ~DRAGOS_OANCEA/freeswitch-dragos:FS-12008 to master

* commit '797216fcc04efd05c0d45b33a4269bd1d8e118ff':
  FS-12008: special case G722 - fix rate passed to switch_core_codec_init()
This commit is contained in:
Mike Jerris
2019-08-19 13:37:47 -05:00
3 changed files with 23 additions and 1 deletions

View File

@@ -614,14 +614,18 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_reset(switch_codec_t *codec)
SWITCH_DECLARE(switch_status_t) switch_core_codec_copy(switch_codec_t *codec, switch_codec_t *new_codec,
const switch_codec_settings_t *codec_settings, switch_memory_pool_t *pool)
{
uint32_t codec_rate;
switch_assert(codec != NULL);
switch_assert(new_codec != NULL);
codec_rate = !strcasecmp(codec->implementation->iananame, "g722")
? codec->implementation->samples_per_second : codec->implementation->actual_samples_per_second;
return switch_core_codec_init(new_codec,
codec->implementation->iananame,
codec->implementation->modname,
codec->fmtp_in,
codec->implementation->actual_samples_per_second,
codec_rate,
codec->implementation->microseconds_per_packet / 1000,
codec->implementation->number_of_channels,
codec->flags,