diff options
author | Alex Launi <alex.launi@canonical.com> | 2010-11-25 20:10:35 -0500 |
---|---|---|
committer | Alex Launi <alex.launi@canonical.com> | 2010-12-03 10:18:05 -0500 |
commit | 7c8add99c1a302840ead85b92e7345bc8f1ca59c (patch) | |
tree | 6949963b44f2cb183733c9f75d3966d86d8fa564 /libbanshee | |
parent | 195f8eb3ae2ff5d3db4d1a39d30c4b897f0a2efa (diff) |
[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).
Diffstat (limited to 'libbanshee')
-rw-r--r-- | libbanshee/banshee-player-pipeline.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/libbanshee/banshee-player-pipeline.c b/libbanshee/banshee-player-pipeline.c index b0363ee00..e0b3759da 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; } |