gnome-speech r315 - in trunk: . drivers/espeak



Author: wwalker
Date: Fri Aug  1 18:13:14 2008
New Revision: 315
URL: http://svn.gnome.org/viewvc/gnome-speech?rev=315&view=rev

Log:
Fix for bug #545896 - eSpeak segmentation fault


Modified:
   trunk/ChangeLog
   trunk/drivers/espeak/espeaksynthesisdriver.c

Modified: trunk/drivers/espeak/espeaksynthesisdriver.c
==============================================================================
--- trunk/drivers/espeak/espeaksynthesisdriver.c	(original)
+++ trunk/drivers/espeak/espeaksynthesisdriver.c	Fri Aug  1 18:13:14 2008
@@ -45,7 +45,7 @@
 } t_user_data;
 
 typedef struct {
-  EspeakSpeaker *espeak_speaker;
+  espeak_VOICE *voice;
   char *text;
   t_user_data *user_data;
 } t_utterance;
@@ -388,6 +388,8 @@
 static void
 espeak_synthesis_driver_free_utterance (t_utterance *utterance)
 {
+  g_free ((void *) utterance->voice->name);
+  g_free (utterance->voice);
   g_free (utterance->text);
   g_free (utterance);
 }
@@ -525,7 +527,7 @@
     espeak_ERROR a_error = EE_INTERNAL_ERROR;
 
     utterance = (t_utterance *) driver->utterance_queue->data;
-    espeak_SetVoiceByProperties(&utterance->espeak_speaker->voice);      
+    espeak_SetVoiceByProperties(utterance->voice);      
     a_error = espeak_Synth((char *) utterance->text, 
 			   strlen((char*)utterance->text) + 1, 
 			   0, POS_CHARACTER, 0, espeakCHARS_UTF8,
@@ -569,7 +571,10 @@
   }
 
   utterance = g_new (t_utterance, 1);
-  utterance->espeak_speaker = espeak_speaker;
+  utterance->voice = g_new (espeak_VOICE, 1);
+  memset(utterance->voice, 0, sizeof(espeak_VOICE));
+  utterance->voice->name = g_strdup (espeak_speaker->voice.name);
+  utterance->voice->gender = espeak_speaker->voice.gender;
   utterance->text = g_strdup (text);
 
   if (speaker->cb != CORBA_OBJECT_NIL) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]