[banshee] [libbanshee] Set alloc-pad property on tee element in pipeline



commit 7c8add99c1a302840ead85b92e7345bc8f1ca59c
Author: Alex Launi <alex launi canonical com>
Date:   Thu Nov 25 20:10:35 2010 -0500

    [libbanshee] Set alloc-pad property on tee element in pipeline
    
    Removes workround for buffer allocation algorithm, by explicitly
    setting which pad to use for buffer allocation (bgo#635125).

 NEWS                                 |    2 +-
 build/m4/banshee/gstreamer.m4        |    2 +-
 libbanshee/banshee-player-pipeline.c |   26 ++++++++++----------------
 3 files changed, 12 insertions(+), 18 deletions(-)
---
diff --git a/NEWS b/NEWS
index 3dde191..c777b53 100644
--- a/NEWS
+++ b/NEWS
@@ -119,7 +119,7 @@ DEPENDENCIES
     * Mono 1.9.1 (.NET 2.0 Profile / gmcs)
     * SQlite 3.4
     * Gtk# 2.12
-    * GStreamer 0.10.12
+    * GStreamer 0.10.23
 
     * NDesk DBus (ndesk-dbus) 0.5
     * NDesk DBus GLib (ndesk-dbus-glib) 0.3
diff --git a/build/m4/banshee/gstreamer.m4 b/build/m4/banshee/gstreamer.m4
index a9b9130..b67deac 100644
--- a/build/m4/banshee/gstreamer.m4
+++ b/build/m4/banshee/gstreamer.m4
@@ -1,6 +1,6 @@
 AC_DEFUN([BANSHEE_CHECK_GSTREAMER],
 [
-	GSTREAMER_REQUIRED_VERSION=0.10.12
+	GSTREAMER_REQUIRED_VERSION=0.10.23
 	AC_SUBST(GSTREAMER_REQUIRED_VERSION)
 
 	PKG_CHECK_MODULES(GST,
diff --git a/libbanshee/banshee-player-pipeline.c b/libbanshee/banshee-player-pipeline.c
index b0363ee..e0b3759 100644
--- a/libbanshee/banshee-player-pipeline.c
+++ b/libbanshee/banshee-player-pipeline.c
@@ -273,6 +273,7 @@ static void bp_volume_changed_callback (GstElement *playbin, GParamSpec *spec, B
 gboolean 
 _bp_pipeline_construct (BansheePlayer *player)
 {
+    GValue value = {0};
     GstBus *bus;
     GstPad *teepad;
     GstElement *audiosink;
@@ -403,27 +404,20 @@ _bp_pipeline_construct (BansheePlayer *player)
     // Connect to the bus to get messages
     bus = gst_pipeline_get_bus (GST_PIPELINE (player->playbin));    
     gst_bus_add_watch (bus, bp_pipeline_bus_callback, player);
+
     
+    GstPad *sinkpad = gst_element_get_pad (audiosinkqueue, "sink");
+    g_value_init (&value, G_OBJECT_TYPE (sinkpad));
+    g_value_set_instance (&value, sinkpad);
+    g_object_set_property (G_OBJECT (player->audiotee), "alloc-pad", &value);
+    g_value_unset (&value);
+
+    // Link the first tee pad to the primary audio sink queue
+    gst_pad_link (gst_element_get_request_pad (player->audiotee, "src0"), sinkpad);
     // Now allow specialized pipeline setups
     _bp_cdda_pipeline_setup (player);
     _bp_video_pipeline_setup (player, bus);
 
-    // This call must be the last one in the pipeline setup to work around a
-    // GStreamer 0.10.21-0.10.22 algorithm that causes the last-allocated pad
-    // to be the one used for buffer allocations.  If the visualization one
-    // winds up being used for that then the pipeline will freeze when
-    // visualizations are disabled.
-    //
-    // When 0.10.23 is more mainstream we can use the new alloc-pad property to
-    // force selection of this pad for allocation.  Until then we just have to
-    // make sure it's the last one allocated.
-    //
-    // -- Chris Howie <cdhowie gmail com>
-
-    // Link the first tee pad to the primary audio sink queue
-    gst_pad_link (gst_element_get_request_pad (player->audiotee, "src0"),
-        gst_element_get_pad (audiosinkqueue, "sink"));
-
     return TRUE;
 }
 



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