Proposed patch for speech problems



Hi all,

This patch should solve all speech problems subjects of bugs:150278, 150048, 
150261. All these fixies are in cvs, but not in tarballs.

The patch is same for both gnopernicus' versions 0.9.7 and 0.9.8.

Please check and let me know if it works.

Regards,
Remus
diff -aburB gnopernicus-0.9.8/speech/libsrs/srs-gs.c gnopernicus/speech/libsrs/srs-gs.c
--- gnopernicus-0.9.8/speech/libsrs/srs-gs.c	2004-07-20 14:47:34.000000000 +0300
+++ gnopernicus/speech/libsrs/srs-gs.c	2004-08-18 09:28:06.000000000 +0300
@@ -82,6 +82,7 @@
 {
     sru_assert (speaker);
 
+    speaker->speaker = NULL;
     speaker->driver = NULL;
     speaker->voice  = NULL;
     speaker->rate   = -1;
@@ -318,7 +319,7 @@
 srs_gs_terminate ()
 {
     sru_assert (srs_gs_outs == NULL);
-    sru_assert (srs_gs_start_marker_waiting == FALSE);
+/*    sru_assert (srs_gs_start_marker_waiting == FALSE);*/
 
     srs_gs_wrap_terminate ();
 }
diff -aburB gnopernicus-0.9.8/speech/libsrs/srs-speech.c gnopernicus/speech/libsrs/srs-speech.c
--- gnopernicus-0.9.8/speech/libsrs/srs-speech.c	2004-07-22 11:59:40.000000000 +0300
+++ gnopernicus/speech/libsrs/srs-speech.c	2004-08-18 09:44:07.000000000 +0300
@@ -503,6 +503,11 @@
     static gpointer last = NULL;
     SRSTextOut	   *tout = id;
 
+#ifdef SRS_NO_MARKERS_SUPPORTED
+    if (srs_no_markers_present)
+	return;
+#endif
+
     if (marker == SRS_MARKER_TEXT_ENDED && g_slist_find (srs_text_outs_speaking, tout))
     {
 	sru_assert (g_slist_find (srs_text_outs_speaking, tout) == srs_text_outs_speaking); /* should be for first position */
diff -aburB gnopernicus-0.9.8/speech/libsrs/srs-xml.c gnopernicus/speech/libsrs/srs-xml.c
--- gnopernicus-0.9.8/speech/libsrs/srs-xml.c	2004-07-23 15:50:12.000000000 +0300
+++ gnopernicus/speech/libsrs/srs-xml.c	2004-08-10 13:31:40.000000000 +0300
@@ -367,6 +367,15 @@
 		    sru_warning ("invalid UTF-8 string \"%s\"", text);
 		    g_free (text);
 		}
+		if (srs_crt_text_out->text)
+		{
+		    gchar *old = srs_crt_text_out->text;
+		    gchar *tmp = g_strndup (ch, count);
+		    srs_crt_text_out->text = g_strconcat (old, tmp, NULL);
+		    g_free (tmp);
+		    g_free (old);
+		}
+		else
 		srs_crt_text_out->text = g_strndup (ch, count);
 	    }
 	    break;
@@ -531,7 +540,7 @@
     sru_assert (srs_xml_initialized);
 
     g_free(srs_ctx);
-    srs_terminate();
+    srs_sp_terminate();
     srs_xml_initialized = FALSE;
 }
diff -aburB gnopernicus-0.9.8/srcore/srspc.c gnopernicus/srcore/srspc.c
--- gnopernicus-0.9.8/srcore/srspc.c	2004-07-23 15:50:13.000000000 +0300
+++ gnopernicus/srcore/srspc.c	2004-08-06 13:09:49.000000000 +0300
@@ -1127,6 +1127,13 @@
 	g_slist_free (tmp);
     }
 #endif
+    if (last_out)
+    {
+        src_speech_idle = TRUE;
+        srcs_out_terminate (last_out);
+	last_out = NULL;
+    }
+
     src_speech_send ("<SRSOUT><SHUTUP/></SRSOUT>");
 }
 
@@ -1226,9 +1233,6 @@
     if (last_out && srcs_out_can_shutup_out (last_out, out))
     {
 	src_speech_shutup ();
-	src_speech_idle = TRUE;
-	srcs_out_terminate (last_out);
-	last_out = NULL;
     }
 
 #ifdef SRS_NO_MARKERS_SUPPORTED
@@ -1506,6 +1510,8 @@
     sru_assert (!src_speech_initialized);
     
     src_speech_idle = TRUE;
+    srcs_outs = NULL;
+    last_out = NULL;
     src_voice_params = g_ptr_array_new ();
     
     src_voices = src_speech_src_voices_new ();
@@ -1573,6 +1579,7 @@
 {
     sru_assert (src_speech_initialized);
 
+    src_speech_shutup ();
 #ifdef SRS_NO_MARKERS_SUPPORTED
     sru_assert (src_speech_unspoken == NULL);
 #endif


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