summary refs log tree commit diff stats
path: root/src/common
diff options
context:
space:
mode:
authorRichard Hitt <rbh00@localhost.localdomain>2013-06-15 17:26:13 -0700
committerRichard Hitt <rbh00@localhost.localdomain>2013-06-15 17:26:13 -0700
commit6a7557da0156b235b8bad58b255e16625a8ed47e (patch)
treec75ffec369055f3037abdc32af8f79083e546624 /src/common
parentd7045e2b6121f7750565f7b9e906bd74fecb72d9 (diff)
parente68635b8e4b0aee7d958c482abbadfc4321cf2b0 (diff)
Merge branch 'master' of http://github.com/hexchat/hexchat
Diffstat (limited to 'src/common')
-rw-r--r--src/common/plugin.c2
-rw-r--r--src/common/text.c19
2 files changed, 14 insertions, 7 deletions
diff --git a/src/common/plugin.c b/src/common/plugin.c
index 61d5cb40..8a704e5f 100644
--- a/src/common/plugin.c
+++ b/src/common/plugin.c
@@ -1826,7 +1826,7 @@ hexchat_pluginpref_set_int (hexchat_plugin *pl, const char *var, int value)
 {
 	char buffer[12];
 
-	sprintf (buffer, "%d", value);
+	snprintf (buffer, sizeof (buffer), "%d", value);
 	return hexchat_pluginpref_set_str_real (pl, var, buffer, 1);
 }
 
diff --git a/src/common/text.c b/src/common/text.c
index 3d1c9280..f0a1dfb1 100644
--- a/src/common/text.c
+++ b/src/common/text.c
@@ -58,6 +58,9 @@ struct pevt_stage1
 	struct pevt_stage1 *next;
 };
 
+#ifdef USE_LIBCANBERRA
+static ca_context *ca_con;
+#endif
 
 static void mkdir_p (char *filename);
 static char *log_create_filename (char *channame);
@@ -2209,9 +2212,6 @@ sound_play (const char *file, gboolean quiet)
 	char *wavfile;
 #ifndef WIN32
 	char *cmd;
-#ifdef USE_LIBCANBERRA
-	ca_context *con;
-#endif
 #endif
 
 	/* the pevents GUI editor triggers this after removing a soundfile */
@@ -2240,9 +2240,16 @@ sound_play (const char *file, gboolean quiet)
 		PlaySound (wavfile, NULL, SND_NODEFAULT|SND_FILENAME|SND_ASYNC);
 #else
 #ifdef USE_LIBCANBERRA
-		ca_context_create (&con);
-		/* TODO: Volume setting? */
-		if (ca_context_play (con, 0, CA_PROP_MEDIA_FILENAME, wavfile, NULL) != 0)
+		if (ca_con == NULL)
+		{
+			ca_context_create (&ca_con);
+			ca_context_change_props (ca_con,
+											CA_PROP_APPLICATION_ID, "hexchat",
+											CA_PROP_APPLICATION_NAME, "HexChat",
+											CA_PROP_APPLICATION_ICON_NAME, "hexchat", NULL);
+		}
+
+		if (ca_context_play (ca_con, 0, CA_PROP_MEDIA_FILENAME, wavfile, NULL) != 0)
 #endif
 		{
 			cmd = g_find_program_in_path ("play");