Commit fab05276 authored by Wim Taymans's avatar Wim Taymans
Browse files

gst/playback/: Refcount fix and more comments.

Original commit message from CVS:
* gst/playback/gstplaybasebin.c: (gen_preroll_element):
* gst/playback/gstplaybin.c: (setup_sinks),
(gst_play_bin_change_state):
Refcount fix and more comments.
parent 10c6b472
2005-07-21 Wim Taymans <wim@fluendo.com>
* gst/playback/gstplaybasebin.c: (gen_preroll_element):
* gst/playback/gstplaybin.c: (setup_sinks),
(gst_play_bin_change_state):
Refcount fix and more comments.
2005-07-21 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/ximage/Makefile.am:
......
......@@ -560,17 +560,17 @@ gen_preroll_element (GstPlayBaseBin * play_base_bin,
g_return_if_reached ();
/* create stream selector */
selector = g_object_new (GST_TYPE_STREAM_SELECTOR, NULL);
padname = gst_pad_get_name (pad);
name = g_strdup_printf ("selector_%s_%s", prename, padname);
selector = g_object_new (GST_TYPE_STREAM_SELECTOR, NULL);
gst_object_set_name (GST_OBJECT (selector), name);
g_free (name);
/* create preroll queue */
name = g_strdup_printf ("preroll_%s_%s", prename, padname);
preroll = gst_element_factory_make ("queue", name);
g_free (padname);
g_free (name);
g_free (padname);
g_object_set (G_OBJECT (preroll),
"max-size-buffers", 0, "max-size-bytes",
......@@ -611,9 +611,11 @@ gen_preroll_element (GstPlayBaseBin * play_base_bin,
/* listen for EOS */
preroll_pad = gst_element_get_pad (preroll, "src");
gst_pad_add_event_probe (preroll_pad, G_CALLBACK (probe_triggered), info);
gst_object_unref (preroll_pad);
/* add to group list */
/* FIXME refcount elements */
/* FIXME refcount elements, after bin_add, object refs are invalid since
* it takes ownership. */
group->type[type - 1].selector = selector;
group->type[type - 1].preroll = preroll;
if (type == GST_STREAM_TYPE_TEXT && play_base_bin->subtitle) {
......
......@@ -827,6 +827,8 @@ setup_sinks (GstPlayBaseBin * play_base_bin, GstPlayBaseGroup * group)
gst_object_unref (pad);
}
/* remove the sinks now, pipeline get_state will now wait for the
* sinks to preroll */
if (play_bin->fakesink) {
gst_bin_remove (GST_BIN (play_bin), play_bin->fakesink);
play_bin->fakesink = NULL;
......@@ -846,6 +848,8 @@ gst_play_bin_change_state (GstElement * element)
switch (transition) {
case GST_STATE_READY_TO_PAUSED:
/* this really is the easiest way to make the state change return
* ASYNC until we added the sinks */
if (!play_bin->fakesink) {
play_bin->fakesink = gst_element_factory_make ("fakesink", "test");
gst_bin_add (GST_BIN (play_bin), play_bin->fakesink);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment