[Freeswitch-svn] [commit] r5618 - freeswitch/trunk/src/mod/asr_tts/mod_openmrcp

Freeswitch SVN achaloyan at freeswitch.org
Mon Aug 20 06:57:27 EDT 2007


Author: achaloyan
Date: Mon Aug 20 06:57:26 2007
New Revision: 5618

Modified:
   freeswitch/trunk/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c

Log:
dos2unix

Modified: freeswitch/trunk/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c
==============================================================================
--- freeswitch/trunk/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c	(original)
+++ freeswitch/trunk/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c	Mon Aug 20 06:57:26 2007
@@ -91,7 +91,7 @@
 	apr_pool_t            *pool;
 	switch_speech_flag_t   flags;
 	switch_mutex_t        *flag_mutex;
-	switch_thread_cond_t  *wait_object;
+	switch_thread_cond_t  *wait_object;
 } openmrcp_session_t;
 
 typedef enum {
@@ -137,10 +137,10 @@
 	openmrcp_session->mrcp_message_last_rcvd = NULL;
 
 	switch_mutex_init(&openmrcp_session->flag_mutex, SWITCH_MUTEX_NESTED, openmrcp_session->pool);
-
-	if (switch_thread_cond_create(&openmrcp_session->wait_object, openmrcp_session->pool)) {
+
+	if (switch_thread_cond_create(&openmrcp_session->wait_object, openmrcp_session->pool)) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,  "wait object creation failed\n");
-	}
+	}
 
 	openmrcp_session->client_session = mrcp_client_context_session_create(openmrcp_session->profile->mrcp_context,openmrcp_session);
 	if (!openmrcp_session->client_session) {
@@ -184,11 +184,11 @@
 	if(!openmrcp_session) {
 		return MRCP_STATUS_FAILURE;
 	}
-	switch_mutex_lock(openmrcp_session->flag_mutex);
+	switch_mutex_lock(openmrcp_session->flag_mutex);
 	openmrcp_session->control_channel = control_channel;
 	openmrcp_session->audio_channel = audio_channel;
-	switch_thread_cond_signal(openmrcp_session->wait_object);
-	switch_mutex_unlock(openmrcp_session->flag_mutex);
+	switch_thread_cond_signal(openmrcp_session->wait_object);
+	switch_mutex_unlock(openmrcp_session->flag_mutex);
 	return MRCP_STATUS_SUCCESS;
 }
 
@@ -333,11 +333,11 @@
 
 	mrcp_client_context_channel_add(asr_session->profile->mrcp_context, asr_session->client_session, asr_channel, NULL);
 
-	switch_mutex_lock(asr_session->flag_mutex);
-	if(switch_thread_cond_timedwait(asr_session->wait_object,asr_session->flag_mutex,5000*1000) != APR_SUCCESS) {
+	switch_mutex_lock(asr_session->flag_mutex);
+	if(switch_thread_cond_timedwait(asr_session->wait_object,asr_session->flag_mutex,5000*1000) != APR_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No response from client stack\n");
-	}
-	switch_mutex_unlock(asr_session->flag_mutex);
+	}
+	switch_mutex_unlock(asr_session->flag_mutex);
 	if(!asr_session->control_channel) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No recognizer channel available\n");
 		return SWITCH_STATUS_FALSE;
@@ -579,11 +579,11 @@
 	}
 	mrcp_client_context_channel_add(tts_session->profile->mrcp_context, tts_session->client_session, tts_channel, NULL);
 
-	switch_mutex_lock(tts_session->flag_mutex);
-	if(switch_thread_cond_timedwait(tts_session->wait_object,tts_session->flag_mutex,5000*1000) != APR_SUCCESS) {
+	switch_mutex_lock(tts_session->flag_mutex);
+	if(switch_thread_cond_timedwait(tts_session->wait_object,tts_session->flag_mutex,5000*1000) != APR_SUCCESS) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No response from client stack\n");
-	}
-	switch_mutex_unlock(tts_session->flag_mutex);
+	}
+	switch_mutex_unlock(tts_session->flag_mutex);
 	if(!tts_session->control_channel) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No synthesizer channel available\n");
 		return SWITCH_STATUS_FALSE;
@@ -631,8 +631,8 @@
 {
 	openmrcp_session_t *tts_session = (openmrcp_session_t *) sh->private_info;
 	size_t return_len=0;
-	media_frame_t media_frame;
-	audio_source_t *audio_source;
+	media_frame_t media_frame;
+	audio_source_t *audio_source;
 
 	if (switch_test_flag(tts_session, FLAG_SPEAK_COMPLETE)) {
 		/* tell fs we are done */
@@ -640,7 +640,7 @@
 		return SWITCH_STATUS_BREAK;
 	}
 
-	audio_source = mrcp_client_audio_source_get(tts_session->audio_channel);
+	audio_source = mrcp_client_audio_source_get(tts_session->audio_channel);
 	if(!audio_source) {
 		return SWITCH_STATUS_BREAK;
 	}
@@ -654,16 +654,16 @@
 
 	/* sampling rate and frame size should be retrieved from audio source */
 	*rate = 8000;
-	media_frame.codec_frame.size = 160;
-	while(return_len < *datalen) {
-		media_frame.codec_frame.buffer = (char*)data + return_len;
-		audio_source->method_set->read_frame(audio_source,&media_frame);
-		if(media_frame.type != MEDIA_FRAME_TYPE_AUDIO) {
-			memset(media_frame.codec_frame.buffer,0,media_frame.codec_frame.size);
-		}
-		return_len += media_frame.codec_frame.size;
-	}
-	*datalen = return_len;
+	media_frame.codec_frame.size = 160;
+	while(return_len < *datalen) {
+		media_frame.codec_frame.buffer = (char*)data + return_len;
+		audio_source->method_set->read_frame(audio_source,&media_frame);
+		if(media_frame.type != MEDIA_FRAME_TYPE_AUDIO) {
+			memset(media_frame.codec_frame.buffer,0,media_frame.codec_frame.size);
+		}
+		return_len += media_frame.codec_frame.size;
+	}
+	*datalen = return_len;
 	return SWITCH_STATUS_SUCCESS;	
 }
 



More information about the Freeswitch-svn mailing list