pidgin: b8752e1e: Set alsasrc's slave-method to 2. This st...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Tue Aug 4 22:20:48 EDT 2009


-----------------------------------------------------------------
Revision: b8752e1e3464dbbb2b0368a112a6d9350cef35cb
Ancestor: 05021ad048bde89b469369cfaa19752f347171b0
Author: maiku at soc.pidgin.im
Date: 2009-08-05T02:17:12
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/b8752e1e3464dbbb2b0368a112a6d9350cef35cb

Modified files:
        libpurple/mediamanager.c

ChangeLog: 

Set alsasrc's slave-method to 2. This stops the audio timestamps from
being screwed up. Thanks to Tester for this fix.

-------------- next part --------------
============================================================
--- libpurple/mediamanager.c	0a13254e42d9954a5dfa01f54e40420550934480
+++ libpurple/mediamanager.c	b4c6a57cf87f94bca2a5459108f2840411018b25
@@ -230,6 +230,7 @@ purple_media_manager_get_pipeline(Purple
 	g_return_val_if_fail(PURPLE_IS_MEDIA_MANAGER(manager), NULL);
 
 	if (manager->priv->pipeline == NULL) {
+		FsElementAddedNotifier *notifier;
 		gchar *filename;
 		GError *err = NULL;
 		GKeyFile *keyfile;
@@ -248,15 +249,8 @@ purple_media_manager_get_pipeline(Purple
 		filename = g_build_filename(purple_user_dir(),
 				"fs-element.conf", NULL);
 		keyfile = g_key_file_new();
-		if (g_key_file_load_from_file(keyfile, filename,
+		if (!g_key_file_load_from_file(keyfile, filename,
 				G_KEY_FILE_NONE, &err)) {
-			FsElementAddedNotifier *notifier =
-					fs_element_added_notifier_new();
-			fs_element_added_notifier_add(notifier,
-					GST_BIN(manager->priv->pipeline));
-			fs_element_added_notifier_set_properties_from_keyfile(
-					notifier, keyfile);
-		} else {
 			if (err->code == 4)
 				purple_debug_info("mediamanager",
 						"Couldn't read "
@@ -268,10 +262,22 @@ purple_media_manager_get_pipeline(Purple
 						"fs-element.conf: %s\n",
 						err->message);
 			g_error_free(err);
-			g_key_file_free(keyfile);
 		}
 		g_free(filename);
 
+		/* Hack to make alsasrc stop messing up audio timestamps */
+		if (!g_key_file_has_key(keyfile,
+				"alsasrc", "slave-method", NULL)) {
+			g_key_file_set_integer(keyfile,
+					"alsasrc", "slave-method", 2);
+		}
+
+		notifier = fs_element_added_notifier_new();
+		fs_element_added_notifier_add(notifier,
+				GST_BIN(manager->priv->pipeline));
+		fs_element_added_notifier_set_properties_from_keyfile(
+				notifier, keyfile);
+
 		gst_element_set_state(manager->priv->pipeline,
 				GST_STATE_PLAYING);
 	}


More information about the Commits mailing list