mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 20:51:58 +00:00
FS-7504: allow <modname>.<codecname> support so multiple modules can exist for the same codec
This commit is contained in:
committed by
Michael Jerris
parent
52d15f6398
commit
7c294f242f
@@ -137,11 +137,12 @@ static switch_status_t tech_init(loopback_private_t *tech_pvt, switch_core_sessi
|
||||
interval = codec->implementation->microseconds_per_packet / 1000;
|
||||
} else {
|
||||
const char *var;
|
||||
char *modname = NULL;
|
||||
|
||||
if ((var = switch_channel_get_variable(channel, "loopback_initial_codec"))) {
|
||||
char *dup = switch_core_session_strdup(session, var);
|
||||
uint32_t bit, channels;
|
||||
iananame = switch_parse_codec_buf(dup, &interval, &rate, &bit, &channels);
|
||||
iananame = switch_parse_codec_buf(dup, &interval, &rate, &bit, &channels, &modname);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -160,6 +161,7 @@ static switch_status_t tech_init(loopback_private_t *tech_pvt, switch_core_sessi
|
||||
status = switch_core_codec_init(&tech_pvt->read_codec,
|
||||
iananame,
|
||||
NULL,
|
||||
NULL,
|
||||
rate, interval, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, switch_core_session_get_pool(session));
|
||||
|
||||
if (status != SWITCH_STATUS_SUCCESS || !tech_pvt->read_codec.implementation || !switch_core_codec_ready(&tech_pvt->read_codec)) {
|
||||
@@ -169,6 +171,7 @@ static switch_status_t tech_init(loopback_private_t *tech_pvt, switch_core_sessi
|
||||
status = switch_core_codec_init(&tech_pvt->write_codec,
|
||||
iananame,
|
||||
NULL,
|
||||
NULL,
|
||||
rate, interval, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, switch_core_session_get_pool(session));
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user