engine->read_impl.samples_per_packet;
}
}
-
- if (session->read_resampler) {
- switch_mutex_lock(session->resample_mutex);
- switch_resample_destroy(&session->read_resampler);
- switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Deactivating read resampler\n");
- switch_mutex_unlock(session->resample_mutex);
- }
-
- if (session->write_resampler) {
- switch_mutex_lock(session->resample_mutex);
- switch_resample_destroy(&session->write_resampler);
- switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Deactivating write resampler\n");
- switch_mutex_unlock(session->resample_mutex);
- }
-
- switch_core_session_reset(session, 0, 0);
-
-
engine->check_frames = 0;
engine->last_ts = 0;
- switch_channel_audio_sync(session->channel);
do_cng = 1;
}
(uint32_t) a_engine->read_impl.microseconds_per_packet / 1000 != a_engine->cur_payload_map->codec_ms ||
a_engine->read_impl.samples_per_second != a_engine->cur_payload_map->rm_rate ) {
+ if (session->read_resampler) {
+ switch_mutex_lock(session->resample_mutex);
+ switch_resample_destroy(&session->read_resampler);
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Deactivating read resampler\n");
+ switch_mutex_unlock(session->resample_mutex);
+ }
+
+ if (session->write_resampler) {
+ switch_mutex_lock(session->resample_mutex);
+ switch_resample_destroy(&session->write_resampler);
+ switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "Deactivating write resampler\n");
+ switch_mutex_unlock(session->resample_mutex);
+ }
+
+ switch_core_session_reset(session, 0, 0);
+ switch_channel_audio_sync(session->channel);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG,
"Changing Codec from %s@%dms@%dhz to %s@%dms@%luhz\n",