mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-31 15:44:21 +00:00
update
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5992 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
a65e34e233
commit
6b1fa2191b
17 files changed
+53
-51
No files matched your search
@@ -4224,7 +4224,7 @@ SWITCH_STANDARD_APP(conference_function)
|
||||
}
|
||||
|
||||
if (read_codec->implementation->actual_samples_per_second != conference->rate) {
|
||||
switch_audio_resampler_t **resampler = read_codec->implementation->samples_per_second > conference->rate ?
|
||||
switch_audio_resampler_t **resampler = read_codec->implementation->actual_samples_per_second > conference->rate ?
|
||||
&member.read_resampler : &member.mux_resampler;
|
||||
|
||||
if (switch_resample_create(resampler,
|
||||
|
||||
@@ -291,7 +291,7 @@ static void asrtest_function(switch_core_session_t *session, char *data)
|
||||
} else {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
|
||||
"Codec Activation Failed %s@%uhz %u channels %dms\n", codec_name,
|
||||
read_codec->implementation->samples_per_second,
|
||||
ah.rate,
|
||||
read_codec->implementation->number_of_channels, read_codec->implementation->microseconds_per_frame / 1000);
|
||||
switch_core_session_reset(session);
|
||||
return;
|
||||
|
||||
@@ -93,11 +93,11 @@ static switch_status_t switch_speex_init(switch_codec_t *codec, switch_codec_fla
|
||||
const SpeexMode *mode = NULL;
|
||||
|
||||
context->codec = codec;
|
||||
if (codec->implementation->samples_per_second == 8000) {
|
||||
if (codec->implementation->actual_samples_per_second == 8000) {
|
||||
mode = &speex_nb_mode;
|
||||
} else if (codec->implementation->samples_per_second == 16000) {
|
||||
} else if (codec->implementation->actual_samples_per_second == 16000) {
|
||||
mode = &speex_wb_mode;
|
||||
} else if (codec->implementation->samples_per_second == 32000) {
|
||||
} else if (codec->implementation->actual_samples_per_second == 32000) {
|
||||
mode = &speex_uwb_mode;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ static switch_status_t switch_speex_init(switch_codec_t *codec, switch_codec_fla
|
||||
speex_encoder_ctl(context->encoder_state, SPEEX_GET_FRAME_SIZE, &context->encoder_frame_size);
|
||||
speex_encoder_ctl(context->encoder_state, SPEEX_SET_COMPLEXITY, &codec->codec_settings.complexity);
|
||||
if (codec->codec_settings.preproc) {
|
||||
context->pp = speex_preprocess_state_init(context->encoder_frame_size, codec->implementation->samples_per_second);
|
||||
context->pp = speex_preprocess_state_init(context->encoder_frame_size, codec->implementation->actual_samples_per_second);
|
||||
speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_VAD, &codec->codec_settings.pp_vad);
|
||||
speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_AGC, &codec->codec_settings.pp_agc);
|
||||
speex_preprocess_ctl(context->pp, SPEEX_PREPROCESS_SET_AGC_LEVEL, &codec->codec_settings.pp_agc_level);
|
||||
|
||||
@@ -223,7 +223,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
|
||||
if (switch_core_file_open(&fh,
|
||||
ring_file,
|
||||
globals.read_codec.implementation->number_of_channels,
|
||||
globals.read_codec.implementation->samples_per_second,
|
||||
globals.read_codec.implementation->actual_samples_per_second,
|
||||
SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL) == SWITCH_STATUS_SUCCESS) {
|
||||
|
||||
if (engage_device(fh.samplerate, fh.channels) != SWITCH_STATUS_SUCCESS) {
|
||||
@@ -582,7 +582,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
|
||||
if (switch_core_file_open(&tech_pvt->fh,
|
||||
tech_pvt->hold_file,
|
||||
globals.read_codec.implementation->number_of_channels,
|
||||
globals.read_codec.implementation->samples_per_second,
|
||||
globals.read_codec.implementation->actual_samples_per_second,
|
||||
SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT,
|
||||
switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_core_codec_destroy(&tech_pvt->write_codec);
|
||||
|
||||
@@ -223,7 +223,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
|
||||
if (switch_core_file_open(&fh,
|
||||
ring_file,
|
||||
globals.read_codec.implementation->number_of_channels,
|
||||
globals.read_codec.implementation->samples_per_second,
|
||||
globals.read_codec.implementation->actual_samples_per_second,
|
||||
SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL) == SWITCH_STATUS_SUCCESS) {
|
||||
|
||||
if (engage_ring_device(fh.samplerate, fh.channels) != SWITCH_STATUS_SUCCESS) {
|
||||
@@ -568,7 +568,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
|
||||
if (switch_core_file_open(&tech_pvt->fh,
|
||||
tech_pvt->hold_file,
|
||||
globals.read_codec.implementation->number_of_channels,
|
||||
globals.read_codec.implementation->samples_per_second,
|
||||
globals.read_codec.implementation->actual_samples_per_second,
|
||||
SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT,
|
||||
switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
|
||||
tech_pvt->hold_file = NULL;
|
||||
|
||||
@@ -1116,14 +1116,14 @@ static switch_status_t js_stream_input_callback(switch_core_session_t *session,
|
||||
step = 1000;
|
||||
}
|
||||
if (step > 0) {
|
||||
samps = step * (codec->implementation->samples_per_second / 1000);
|
||||
samps = step * (codec->implementation->actual_samples_per_second / 1000);
|
||||
switch_core_file_seek(fh, &pos, samps, SEEK_CUR);
|
||||
} else {
|
||||
samps = step * (codec->implementation->samples_per_second / 1000);
|
||||
samps = step * (codec->implementation->actual_samples_per_second / 1000);
|
||||
switch_core_file_seek(fh, &pos, fh->pos - samps, SEEK_SET);
|
||||
}
|
||||
} else {
|
||||
samps = atoi(p) * (codec->implementation->samples_per_second / 1000);
|
||||
samps = atoi(p) * (codec->implementation->actual_samples_per_second / 1000);
|
||||
switch_core_file_seek(fh, &pos, samps, SEEK_SET);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ static JSBool teletone_construct(JSContext * cx, JSObject * obj, uintN argc, jsv
|
||||
if (switch_core_codec_init(&tto->codec,
|
||||
"L16",
|
||||
NULL,
|
||||
read_codec->implementation->samples_per_second,
|
||||
read_codec->implementation->actual_samples_per_second,
|
||||
read_codec->implementation->microseconds_per_frame / 1000,
|
||||
read_codec->implementation->number_of_channels,
|
||||
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, pool) == SWITCH_STATUS_SUCCESS) {
|
||||
|
||||
Reference in new issue
Block a user