From faa1d71a2e931649fa0ddd9ab2f39d38f9c3befc Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 11 Oct 2004 09:35:48 +0000 Subject: [PATCH] gst/playback/gstplaybasebin.c: Cleanup the previous pipeline a little earlier for the case that a source element prov... Original commit message from CVS: * gst/playback/gstplaybasebin.c: (setup_source): Cleanup the previous pipeline a little earlier for the case that a source element provides raw data. --- ChangeLog | 12 +++++++++++- gst/playback/gstplaybasebin.c | 21 +++++++++++---------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index ee495d2f9e..1a4f5af873 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-10-11 Wim Taymans + + * gst/playback/gstplaybasebin.c: (setup_source): + Cleanup the previous pipeline a little earlier for the + case that a source element provides raw data. + 2004-10-11 Benjamin Otte * ext/mad/gstid3tag.c: (gst_id3_tag_chain): @@ -84,6 +90,11 @@ cdparanoia. disconnect the preroll overrun signal when we don't need it anymore. +2004-10-08 Milosz Derezynski + + * ext/cdparanoia/gstcdparanoia.c: (_do_init), + Added reworked patch from #154903 from milosz derezynski (deadchip). + 2004-10-08 Wim Taymans * ext/cdparanoia/gstcdparanoia.c: (_do_init), @@ -93,7 +104,6 @@ (cdparanoia_uri_get_protocols), (cdparanoia_uri_get_uri), (cdparanoia_uri_set_uri), (cdparanoia_uri_handler_init): * ext/cdparanoia/gstcdparanoia.h: - Added reworked patch from #154903 from milosz derezynski (deadchip). This adds the cdda:// uri. 2004-10-08 Wim Taymans diff --git a/gst/playback/gstplaybasebin.c b/gst/playback/gstplaybasebin.c index d8d40e089b..7869304076 100644 --- a/gst/playback/gstplaybasebin.c +++ b/gst/playback/gstplaybasebin.c @@ -381,6 +381,7 @@ static gboolean setup_source (GstPlayBaseBin * play_base_bin) { GstElement *old_src; + GstElement *old_dec; GstPad *srcpad = NULL; if (!play_base_bin->need_rebuild) @@ -409,6 +410,14 @@ setup_source (GstPlayBaseBin * play_base_bin) } } + old_dec = play_base_bin->decoder; + if (old_dec) { + GST_LOG ("removing old decoder element %s", gst_element_get_name (old_dec)); + gst_bin_remove (GST_BIN (play_base_bin->thread), old_dec); + } + + remove_prerolls (play_base_bin); + /* now see if the source element emits raw audio/video all by itself, * if so, we can create streams for the pads and be done with it */ @@ -461,9 +470,6 @@ setup_source (GstPlayBaseBin * play_base_bin) { gboolean res; gint sig1, sig2, sig3, sig4; - GstElement *old_dec; - - old_dec = play_base_bin->decoder; play_base_bin->decoder = gst_element_factory_make ("decodebin", "decoder"); if (!play_base_bin->decoder) { @@ -471,16 +477,11 @@ setup_source (GstPlayBaseBin * play_base_bin) play_base_bin->decoder = old_dec; return FALSE; } else { - if (old_dec) { - GST_LOG ("removing old decoder element %s", - gst_element_get_name (old_dec)); - gst_bin_remove (GST_BIN (play_base_bin->thread), old_dec); - } + /* ref decoder so that the bin does not take ownership */ + gst_object_ref (GST_OBJECT (play_base_bin->decoder)); gst_bin_add (GST_BIN (play_base_bin->thread), play_base_bin->decoder); } - remove_prerolls (play_base_bin); - res = gst_pad_link (srcpad, gst_element_get_pad (play_base_bin->decoder, "sink")); if (!res) {