changeset 23074:fb87b6d77543

A (modified) patch from Felipe to simplify our GStreamer sink selection code. There's no need to initialize autoaudiosink ourselves, as playbin will do that for us if we pass NULL. Fixes #5770 committer: Richard Laager <rlaager@wiktel.com>
author Felipe Contreras <felipe.contreras@gmail.com>
date Wed, 21 May 2008 22:06:52 +0000
parents be8c6b5cc726
children 8b8603d354be
files pidgin/gtksound.c
diffstat 1 files changed, 5 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtksound.c	Wed May 21 21:07:22 2008 +0000
+++ b/pidgin/gtksound.c	Wed May 21 22:06:52 2008 +0000
@@ -491,26 +491,12 @@
 		if (purple_running_gnome()) {
 			sink = gst_element_factory_make("gconfaudiosink", "sink");
 		}
-		if (!sink)
-			sink = gst_element_factory_make("autoaudiosink", "sink");
-		if (!sink) {
-			purple_debug_error("sound", "Unable to create GStreamer audiosink.\n");
-			return;
-		}
 	}
 #ifndef _WIN32
 	else if (!strcmp(method, "esd")) {
 		sink = gst_element_factory_make("esdsink", "sink");
-		if (!sink) {
-			purple_debug_error("sound", "Unable to create GStreamer audiosink.\n");
-			return;
-		}
 	} else if (!strcmp(method, "alsa")) {
 		sink = gst_element_factory_make("alsasink", "sink");
-		if (!sink) {
-			purple_debug_error("sound", "Unable to create GStreamer audiosink.\n");
-			return;
-		}
 	}
 #endif
 	else {
@@ -518,6 +504,11 @@
 		return;
 	}
 
+	if (strcmp(method, "automatic") != 0 && !sink) {
+		purple_debug_error("sound", "Unable to create GStreamer audiosink.\n");
+		return;
+	}
+
 	play = gst_element_factory_make("playbin", "play");
 
 	if (play == NULL) {