[sound-juicer] Don't set an audiosink on playbin for the preview and disable video output



commit 39d9415d07d66c8de3318523f84b180fbfbbd4a3
Author: Sebastian DrÃge <sebastian droege collabora co uk>
Date:   Thu Jul 5 15:41:20 2012 +0200

    Don't set an audiosink on playbin for the preview and disable video output
    
    This will make sure that the optimal audio sink is chosen and no video
    is played whatsoever.

 src/egg-play-preview.c |   25 +++++++++----------------
 1 files changed, 9 insertions(+), 16 deletions(-)
---
diff --git a/src/egg-play-preview.c b/src/egg-play-preview.c
index 0d7c8c9..9c664d6 100644
--- a/src/egg-play-preview.c
+++ b/src/egg-play-preview.c
@@ -518,8 +518,8 @@ static void
 _setup_pipeline (EggPlayPreview *play_preview)
 {
 	EggPlayPreviewPrivate *priv;
-	GstElement *audiosink;
 	GstBus *bus = NULL;
+        guint flags;
 
 	priv = GET_PRIVATE (play_preview);
 
@@ -529,21 +529,14 @@ _setup_pipeline (EggPlayPreview *play_preview)
 	if (!priv->playbin)
 		return;
 
-	audiosink = gst_element_factory_make ("gconfaudiosink", "audiosink");
-	if (!audiosink) {
-		audiosink = gst_element_factory_make ("autoaudiosink", "audiosink");
-		if (!audiosink) {
-			audiosink = gst_element_factory_make ("alsasink", "audiosink");
-			if (!audiosink) {
-				return;
-			}
-		}
-	}
-
+        /* Disable video output */
+        g_object_get (G_OBJECT (priv->playbin),
+                      "flags", &flags,
+                      NULL);
+        flags &= ~0x00000001;
 	g_object_set (G_OBJECT (priv->playbin),
-				  "audio-sink", audiosink,
-				  "video-sink", NULL,
-				  NULL);
+                      "flags", flags,
+                      NULL);
 
 	bus = gst_pipeline_get_bus (GST_PIPELINE (priv->playbin));
 	gst_bus_add_watch (bus, (GstBusFunc) _process_bus_messages, play_preview);
@@ -566,7 +559,7 @@ _clear_pipeline (EggPlayPreview *play_preview)
 		gst_object_unref (bus);
 
 		gst_element_set_state (priv->playbin, GST_STATE_NULL);
-        gst_object_unref (GST_OBJECT (priv->playbin));
+                gst_object_unref (GST_OBJECT (priv->playbin));
 		priv->playbin = NULL;
 	}
 }



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