add checking for successful re-sampler allocation. Add ifdefs to disable build with re-sampler.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4782 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris
2007-03-28 18:21:00 +00:00
parent 0958553f39
commit e5dff3e822
3 changed files with 33 additions and 4 deletions
@@ -4070,12 +4070,15 @@ static void conference_function(switch_core_session_t *session, char *data)
switch_audio_resampler_t **resampler = read_codec->implementation->samples_per_second > conference->rate ?
&member.read_resampler : &member.mux_resampler;
switch_resample_create(resampler,
if (switch_resample_create(resampler,
read_codec->implementation->samples_per_second,
read_codec->implementation->samples_per_second * 20,
conference->rate,
conference->rate * 20,
member.pool);
member.pool) != SWITCH_STATUS_SUCCESS){
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Unable to crete resampler!\n");
goto done;
}
/* Setup an audio buffer for the resampled audio */
if (switch_buffer_create_dynamic(&member.resample_buffer, CONF_DBLOCK_SIZE, CONF_DBUFFER_SIZE, CONF_DBUFFER_MAX) != SWITCH_STATUS_SUCCESS) {