[Freeswitch-svn] [commit] r5992 - in freeswitch/trunk/src: . mod/applications/mod_conference mod/applications/mod_ivrtest mod/codecs/mod_speex mod/endpoints/mod_alsa mod/endpoints/mod_portaudio mod/languages/mod_spidermonkey mod/languages/mod_spidermonkey_teletone

Freeswitch SVN anthm at freeswitch.org
Fri Oct 19 11:31:03 EDT 2007


Author: anthm
Date: Fri Oct 19 11:31:02 2007
New Revision: 5992

Modified:
   freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
   freeswitch/trunk/src/mod/applications/mod_ivrtest/mod_ivrtest.c
   freeswitch/trunk/src/mod/codecs/mod_speex/mod_speex.c
   freeswitch/trunk/src/mod/endpoints/mod_alsa/mod_alsa.c
   freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c
   freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
   freeswitch/trunk/src/mod/languages/mod_spidermonkey_teletone/mod_spidermonkey_teletone.c
   freeswitch/trunk/src/switch_channel.c
   freeswitch/trunk/src/switch_core_codec.c
   freeswitch/trunk/src/switch_core_io.c
   freeswitch/trunk/src/switch_core_media_bug.c
   freeswitch/trunk/src/switch_ivr.c
   freeswitch/trunk/src/switch_ivr_async.c
   freeswitch/trunk/src/switch_ivr_originate.c
   freeswitch/trunk/src/switch_ivr_play_say.c
   freeswitch/trunk/src/switch_loadable_module.c
   freeswitch/trunk/src/switch_rtp.c

Log:
update

Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c	Fri Oct 19 11:31:02 2007
@@ -4224,7 +4224,7 @@
 	}
 
 	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,

Modified: freeswitch/trunk/src/mod/applications/mod_ivrtest/mod_ivrtest.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_ivrtest/mod_ivrtest.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_ivrtest/mod_ivrtest.c	Fri Oct 19 11:31:02 2007
@@ -291,7 +291,7 @@
 			} 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;

Modified: freeswitch/trunk/src/mod/codecs/mod_speex/mod_speex.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_speex/mod_speex.c	(original)
+++ freeswitch/trunk/src/mod/codecs/mod_speex/mod_speex.c	Fri Oct 19 11:31:02 2007
@@ -93,11 +93,11 @@
 		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 @@
 			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);

Modified: freeswitch/trunk/src/mod/endpoints/mod_alsa/mod_alsa.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_alsa/mod_alsa.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_alsa/mod_alsa.c	Fri Oct 19 11:31:02 2007
@@ -223,7 +223,7 @@
 				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 @@
 				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);

Modified: freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_portaudio/mod_portaudio.c	Fri Oct 19 11:31:02 2007
@@ -223,7 +223,7 @@
 				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 @@
 				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;

Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	(original)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	Fri Oct 19 11:31:02 2007
@@ -1116,14 +1116,14 @@
 						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);
 				}
 			}

Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey_teletone/mod_spidermonkey_teletone.c
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_spidermonkey_teletone/mod_spidermonkey_teletone.c	(original)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey_teletone/mod_spidermonkey_teletone.c	Fri Oct 19 11:31:02 2007
@@ -112,7 +112,7 @@
 	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) {

Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c	(original)
+++ freeswitch/trunk/src/switch_channel.c	Fri Oct 19 11:31:02 2007
@@ -780,12 +780,12 @@
 
 	if ((codec = switch_core_session_get_read_codec(channel->session)) && codec->implementation) {
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Read-Codec-Name", "%s", switch_str_nil(codec->implementation->iananame));
-		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Read-Codec-Rate", "%u", codec->implementation->samples_per_second);
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Read-Codec-Rate", "%u", codec->implementation->actual_samples_per_second);
 	}
 
 	if ((codec = switch_core_session_get_write_codec(channel->session)) && codec->implementation) {
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Write-Codec-Name", "%s", switch_str_nil(codec->implementation->iananame));
-		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Write-Codec-Rate", "%u", codec->implementation->samples_per_second);
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Write-Codec-Rate", "%u", codec->implementation->actual_samples_per_second);
 	}
 
 	/* Index Caller's Profile */

Modified: freeswitch/trunk/src/switch_core_codec.c
==============================================================================
--- freeswitch/trunk/src/switch_core_codec.c	(original)
+++ freeswitch/trunk/src/switch_core_codec.c	Fri Oct 19 11:31:02 2007
@@ -44,6 +44,7 @@
 		switch_channel_event_set_data(session->channel, event);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-read-codec-name", "%s", codec->implementation->iananame);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-read-codec-rate", "%d", codec->implementation->samples_per_second);
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-actual-read-codec-rate", "%d", codec->implementation->actual_samples_per_second);
 		switch_event_fire(&event);
 	}
 
@@ -70,6 +71,7 @@
 		switch_channel_event_set_data(session->channel, event);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-write-codec-name", "%s", codec->implementation->iananame);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-write-codec-rate", "%d", codec->implementation->samples_per_second);
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-actual-write-codec-rate", "%d", codec->implementation->actual_samples_per_second);
 		switch_event_fire(&event);
 	}
 

Modified: freeswitch/trunk/src/switch_core_io.c
==============================================================================
--- freeswitch/trunk/src/switch_core_io.c	(original)
+++ freeswitch/trunk/src/switch_core_io.c	Fri Oct 19 11:31:02 2007
@@ -167,7 +167,7 @@
 											  session->read_codec,
 											  read_frame->data,
 											  read_frame->datalen,
-											  session->read_codec->implementation->samples_per_second,
+											  session->read_codec->implementation->actual_samples_per_second,
 											  session->raw_read_frame.data, &session->raw_read_frame.datalen, &session->raw_read_frame.rate, &flag);
 
 			if (do_resample && status == SWITCH_STATUS_SUCCESS) {
@@ -304,7 +304,7 @@
 																					session->raw_read_frame.data,
 																					session->read_codec->implementation->bytes_per_frame);
 
-					session->raw_read_frame.rate = session->read_codec->implementation->samples_per_second;
+					session->raw_read_frame.rate = session->read_codec->implementation->actual_samples_per_second;
 					enc_frame = &session->raw_read_frame;
 				}
 				session->enc_read_frame.datalen = session->enc_read_frame.buflen;
@@ -317,7 +317,7 @@
 												  enc_frame->codec,
 												  enc_frame->data,
 												  enc_frame->datalen,
-												  session->read_codec->implementation->samples_per_second,
+												  session->read_codec->implementation->actual_samples_per_second,
 												  session->enc_read_frame.data, &session->enc_read_frame.datalen, &session->enc_read_frame.rate, &flag);
 
 
@@ -443,7 +443,7 @@
 											  session->write_codec,
 											  frame->data,
 											  frame->datalen,
-											  session->write_codec->implementation->samples_per_second,
+											  session->write_codec->implementation->actual_samples_per_second,
 											  session->raw_write_frame.data, &session->raw_write_frame.datalen, &session->raw_write_frame.rate, &flag);
 
 
@@ -597,7 +597,7 @@
 												  frame->codec,
 												  enc_frame->data,
 												  enc_frame->datalen,
-												  session->write_codec->implementation->samples_per_second,
+												  session->write_codec->implementation->actual_samples_per_second,
 												  session->enc_write_frame.data, &session->enc_write_frame.datalen, &session->enc_write_frame.rate, &flag);
 
 				switch (status) {
@@ -650,13 +650,13 @@
 							 switch_buffer_read(session->raw_write_buffer, session->raw_write_frame.data, bytes)) != 0) {
 							int rate;
 							enc_frame = &session->raw_write_frame;
-							session->raw_write_frame.rate = session->write_codec->implementation->samples_per_second;
+							session->raw_write_frame.rate = session->write_codec->implementation->actual_samples_per_second;
 							session->enc_write_frame.datalen = session->enc_write_frame.buflen;
 
 							if (frame->codec && frame->codec->implementation) {
-								rate = frame->codec->implementation->samples_per_second;
+								rate = frame->codec->implementation->actual_samples_per_second;
 							} else {
-								rate = session->write_codec->implementation->samples_per_second;
+								rate = session->write_codec->implementation->actual_samples_per_second;
 							} 
 
 							status = switch_core_codec_encode(session->write_codec,

Modified: freeswitch/trunk/src/switch_core_media_bug.c
==============================================================================
--- freeswitch/trunk/src/switch_core_media_bug.c	(original)
+++ freeswitch/trunk/src/switch_core_media_bug.c	Fri Oct 19 11:31:02 2007
@@ -160,7 +160,7 @@
 
 		frame->datalen = bytes;
 		frame->samples = bytes / sizeof(int16_t);
-		frame->rate = read_codec->implementation->samples_per_second;
+		frame->rate = read_codec->implementation->actual_samples_per_second;
 		
 		return SWITCH_STATUS_SUCCESS;
 	}

Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c	(original)
+++ freeswitch/trunk/src/switch_ivr.c	Fri Oct 19 11:31:02 2007
@@ -202,16 +202,16 @@
 		if (switch_core_codec_init(&conninfo->read_codec,
 								   "L16",
 								   NULL,
-								   read_codec->implementation->samples_per_second,
+								   read_codec->implementation->actual_samples_per_second,
 								   read_codec->implementation->microseconds_per_frame / 1000,
 								   1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
 								   NULL, switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
 							  "Raw Codec Activation Success L16@%uhz 1 channel %dms\n",
-							  read_codec->implementation->samples_per_second, read_codec->implementation->microseconds_per_frame / 1000);
+							  read_codec->implementation->actual_samples_per_second, read_codec->implementation->microseconds_per_frame / 1000);
 		} else {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activation Failed L16@%uhz 1 channel %dms\n",
-							  read_codec->implementation->samples_per_second, read_codec->implementation->microseconds_per_frame / 1000);
+							  read_codec->implementation->actual_samples_per_second, read_codec->implementation->microseconds_per_frame / 1000);
 			goto fail;
 		}
 	}
@@ -445,7 +445,7 @@
 					switch_size_t len = 0;
 					uint32_t flags = 0;
 					switch_byte_t decoded[SWITCH_RECOMMENDED_BUFFER_SIZE];
-					uint32_t rate = read_codec->implementation->samples_per_second;
+					uint32_t rate = read_codec->implementation->actual_samples_per_second;
 					uint32_t dlen = sizeof(decoded);
 					switch_status_t status;
 					switch_byte_t *sendbuf = NULL;
@@ -465,7 +465,7 @@
 															  &conninfo->read_codec,
 															  read_frame->data,
 															  read_frame->datalen,
-															  read_codec->implementation->samples_per_second,
+															  read_codec->implementation->actual_samples_per_second,
 															  decoded, &dlen, &rate, &flags);
 						}
 						switch (status) {

Modified: freeswitch/trunk/src/switch_ivr_async.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_async.c	(original)
+++ freeswitch/trunk/src/switch_ivr_async.c	Fri Oct 19 11:31:02 2007
@@ -207,13 +207,13 @@
 	assert(read_codec != NULL);
 
 	dh->fh.channels = read_codec->implementation->number_of_channels;
-	dh->fh.samplerate = read_codec->implementation->samples_per_second;
+	dh->fh.samplerate = read_codec->implementation->actual_samples_per_second;
 
 
 	if (switch_core_file_open(&dh->fh,
 							  file,
 							  read_codec->implementation->number_of_channels,
-							  read_codec->implementation->samples_per_second,
+							  read_codec->implementation->actual_samples_per_second,
 							  SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT,
 							  switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
 		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
@@ -329,13 +329,13 @@
 	}
 	
 	fh->channels = channels;
-	fh->samplerate = read_codec->implementation->samples_per_second;
+	fh->samplerate = read_codec->implementation->actual_samples_per_second;
 
 
 	if (switch_core_file_open(fh,
 							  file,
 							  channels,
-							  read_codec->implementation->samples_per_second,
+							  read_codec->implementation->actual_samples_per_second,
 							  SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error opening %s\n", file);
 		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
@@ -470,7 +470,7 @@
 		return SWITCH_STATUS_MEMERR;
 	}
 
-	teletone_dtmf_detect_init(&pvt->dtmf_detect, read_codec->implementation->samples_per_second);
+	teletone_dtmf_detect_init(&pvt->dtmf_detect, read_codec->implementation->actual_samples_per_second);
 
 	pvt->session = session;
 
@@ -668,7 +668,7 @@
   }
 
   cont->list[cont->index].up = 1;
-  cont->list[cont->index].mt.sample_rate = read_codec->implementation->samples_per_second;
+  cont->list[cont->index].mt.sample_rate = read_codec->implementation->actual_samples_per_second;
   teletone_multi_tone_init(&cont->list[cont->index].mt, &cont->list[cont->index].map);
   cont->session = session;
   
@@ -952,7 +952,7 @@
 	if (switch_core_asr_open(ah,
 							 mod_name,
 							 "L16",
-							 read_codec->implementation->samples_per_second, dest, &flags,
+							 read_codec->implementation->actual_samples_per_second, dest, &flags,
 							 switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) {
 
 		if (switch_core_asr_load_grammar(ah, grammar, path) != SWITCH_STATUS_SUCCESS) {

Modified: freeswitch/trunk/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_originate.c	(original)
+++ freeswitch/trunk/src/switch_ivr_originate.c	Fri Oct 19 11:31:02 2007
@@ -615,7 +615,7 @@
 					if (switch_core_codec_init(&write_codec,
 											   "L16",
 											   NULL,
-											   read_codec->implementation->samples_per_second,
+											   read_codec->implementation->actual_samples_per_second,
 											   read_codec->implementation->microseconds_per_frame / 1000,
 											   1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, 
 											   switch_core_session_get_pool(session)) == SWITCH_STATUS_SUCCESS) {
@@ -623,7 +623,7 @@
 
 						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
 										  "Raw Codec Activation Success L16@%uhz 1 channel %dms\n",
-										  read_codec->implementation->samples_per_second, read_codec->implementation->microseconds_per_frame / 1000);
+										  read_codec->implementation->actual_samples_per_second, read_codec->implementation->microseconds_per_frame / 1000);
 						write_frame.codec = &write_codec;
 						write_frame.datalen = read_codec->implementation->bytes_per_frame;
 						write_frame.samples = write_frame.datalen / 2;
@@ -652,11 +652,11 @@
 								switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Play Ringback File [%s]\n", ringback_data);
 
 								ringback.fhb.channels = read_codec->implementation->number_of_channels;
-								ringback.fhb.samplerate = read_codec->implementation->samples_per_second;
+								ringback.fhb.samplerate = read_codec->implementation->actual_samples_per_second;
 								if (switch_core_file_open(&ringback.fhb,
 														  ringback_data,
 														  read_codec->implementation->number_of_channels,
-														  read_codec->implementation->samples_per_second,
+														  read_codec->implementation->actual_samples_per_second,
 														  SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT,
 														  switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
 									switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Playing File\n");
@@ -668,7 +668,7 @@
 
 							} else {
 								teletone_init_session(&ringback.ts, 0, teletone_handler, &ringback);
-								ringback.ts.rate = read_codec->implementation->samples_per_second;
+								ringback.ts.rate = read_codec->implementation->actual_samples_per_second;
 								switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Play Ringback Tone [%s]\n", ringback_data);
 								//ringback.ts.debug = 1;
 								//ringback.ts.debug_stream = switch_core_get_console();

Modified: freeswitch/trunk/src/switch_ivr_play_say.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_play_say.c	(original)
+++ freeswitch/trunk/src/switch_ivr_play_say.c	Fri Oct 19 11:31:02 2007
@@ -341,13 +341,13 @@
 	assert(read_codec != NULL);
 
 	fh->channels = read_codec->implementation->number_of_channels;
-	fh->samplerate = read_codec->implementation->samples_per_second;
+	fh->samplerate = read_codec->implementation->actual_samples_per_second;
 
 
 	if (switch_core_file_open(fh,
 							  file,
 							  read_codec->implementation->number_of_channels,
-							  read_codec->implementation->samples_per_second,
+							  read_codec->implementation->actual_samples_per_second,
 							  SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
 		switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
 		switch_core_session_reset(session);
@@ -396,7 +396,7 @@
 	if (switch_core_codec_init(&codec,
 							   codec_name,
 							   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,
@@ -563,7 +563,7 @@
 	if (switch_core_codec_init(&write_codec,
 							   "L16",
 							   NULL,
-							   read_codec->implementation->samples_per_second,
+							   read_codec->implementation->actual_samples_per_second,
 							   read_codec->implementation->microseconds_per_frame / 1000,
 							   1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, 
 							   NULL, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
@@ -576,7 +576,7 @@
 
 	switch_buffer_create_dynamic(&audio_buffer, 512, 1024, 0);
 	teletone_init_session(&ts, 0, teletone_handler, audio_buffer);
-	ts.rate = read_codec->implementation->samples_per_second;
+	ts.rate = read_codec->implementation->actual_samples_per_second;
 	ts.channels = 1;
 	teletone_run(&ts, script);
 
@@ -722,7 +722,7 @@
 	if (switch_core_file_open(fh,
 							  file,
 							  read_codec->implementation->number_of_channels,
-							  read_codec->implementation->samples_per_second,
+							  read_codec->implementation->actual_samples_per_second,
 							  SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
 		switch_core_session_reset(session);
 		return SWITCH_STATUS_NOTFOUND;

Modified: freeswitch/trunk/src/switch_loadable_module.c
==============================================================================
--- freeswitch/trunk/src/switch_loadable_module.c	(original)
+++ freeswitch/trunk/src/switch_loadable_module.c	Fri Oct 19 11:31:02 2007
@@ -163,7 +163,7 @@
 					for (impl = ptr->implementations; impl; impl = impl->next) {
 						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE,
 										  "Adding Codec '%s' (%s) %dhz %dms\n",
-										  impl->iananame, ptr->interface_name, impl->samples_per_second, impl->microseconds_per_frame / 1000);
+										  impl->iananame, ptr->interface_name, impl->actual_samples_per_second, impl->microseconds_per_frame / 1000);
 						if (!switch_core_hash_find(loadable_modules.codec_hash, impl->iananame)) {
 							switch_core_hash_insert(loadable_modules.codec_hash, impl->iananame, (const void *) ptr);
 						}
@@ -429,7 +429,7 @@
 					for (impl = ptr->implementations; impl; impl = impl->next) {
 						switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE,
 										  "Deleting Codec '%s' (%s) %dhz %dms\n",
-										  impl->iananame, ptr->interface_name, impl->samples_per_second, impl->microseconds_per_frame / 1000);
+										  impl->iananame, ptr->interface_name, impl->actual_samples_per_second, impl->microseconds_per_frame / 1000);
 						if (switch_core_hash_find(loadable_modules.codec_hash, impl->iananame)) {
 							switch_core_hash_delete(loadable_modules.codec_hash, impl->iananame);
 						}

Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c	(original)
+++ freeswitch/trunk/src/switch_rtp.c	Fri Oct 19 11:31:02 2007
@@ -1343,7 +1343,7 @@
 									 rtp_session->vad_data.read_codec,
 									 data,
 									 datalen,
-									 rtp_session->vad_data.read_codec->implementation->samples_per_second,
+									 rtp_session->vad_data.read_codec->implementation->actual_samples_per_second,
 									 decoded, &len, &rate, &flags) == SWITCH_STATUS_SUCCESS) {
 			
 



More information about the Freeswitch-svn mailing list