Commit ecb6c197 authored by Wim Taymans's avatar Wim Taymans

gst/playback/: Unlink the signal handler when we found the type, we're not...

gst/playback/: Unlink the signal handler when we found the type, we're not going to do anything sensible with more ty...

Original commit message from CVS:
* gst/playback/gstdecodebin.c: (add_fakesink), (type_found):
* gst/playback/gstdecodebin2.c: (gst_decode_bin_init),
(type_found):
Unlink the signal handler when we found the type, we're not going to do
anything sensible with more type_found signals anyway.
parent aa2e910c
2007-10-08 Wim Taymans <wim.taymans@gmail.com>
* gst/playback/gstdecodebin.c: (add_fakesink), (type_found):
* gst/playback/gstdecodebin2.c: (gst_decode_bin_init),
(type_found):
Unlink the signal handler when we found the type, we're not going to do
anything sensible with more type_found signals anyway.
2007-10-06 Tim-Philipp Müller <tim at centricular dot net>
* gst-libs/gst/tag/gsttagdemux.c:
......@@ -583,6 +583,7 @@ add_fakesink (GstDecodeBin * decode_bin)
/* hacky, remove sink flag, we don't want our decodebin to become a sink
* just because we add a fakesink element to make us ASYNC */
GST_OBJECT_FLAG_UNSET (decode_bin->fakesink, GST_ELEMENT_IS_SINK);
/* takes ownership */
if (!gst_bin_add (GST_BIN (decode_bin), decode_bin->fakesink)) {
g_warning ("Could not add fakesink element, decodebin will not work");
......@@ -1539,6 +1540,12 @@ type_found (GstElement * typefind, guint probability, GstCaps * caps,
if (decode_bin->shutting_down)
goto shutting_down;
/* don't need the typefind anymore, we're not going to dynamically change
* elements anyway */
if (decode_bin->have_type_id)
g_signal_handler_disconnect (G_OBJECT (typefind), decode_bin->have_type_id);
decode_bin->have_type_id = 0;
GST_DEBUG_OBJECT (decode_bin, "typefind found caps %" GST_PTR_FORMAT, caps);
/* special-case text/plain: we only want to accept it as a raw type if it
......
......@@ -95,6 +95,8 @@ struct _GstDecodeBin
GstCaps *caps; /* caps on which to stop decoding */
GList *factories; /* factories we can use for selecting elements */
guint have_type_id; /* signal id for have-type from typefind */
};
struct _GstDecodeBinClass
......@@ -541,7 +543,8 @@ gst_decode_bin_init (GstDecodeBin * decode_bin)
/* connect a signal to find out when the typefind element found
* a type */
g_signal_connect (G_OBJECT (decode_bin->typefind), "have_type",
decode_bin->have_type_id =
g_signal_connect (G_OBJECT (decode_bin->typefind), "have-type",
G_CALLBACK (type_found), decode_bin);
}
......@@ -1143,6 +1146,10 @@ type_found (GstElement * typefind, guint probability,
GST_DEBUG_OBJECT (decode_bin, "typefind found caps %" GST_PTR_FORMAT, caps);
if (decode_bin->have_type_id)
g_signal_handler_disconnect (typefind, decode_bin->have_type_id);
decode_bin->have_type_id = 0;
pad = gst_element_get_static_pad (typefind, "src");
analyze_new_pad (decode_bin, typefind, pad, caps, NULL);
......
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