mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-26 00:58:12 +00:00
gst/playback/: Don't disconnect the have_type signal because we never reconnect it later on. Instead keep a variable ...
Original commit message from CVS: * gst/playback/gstdecodebin.c: (type_found), (gst_decode_bin_change_state): * gst/playback/gstdecodebin2.c: (type_found), (gst_decode_bin_change_state): Don't disconnect the have_type signal because we never reconnect it later on. Instead keep a variable to see if we already detected a type.
This commit is contained in:
parent
ecb6c19729
commit
d0897a3528
3 changed files with 29 additions and 11 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
2007-10-08 Wim Taymans <wim.taymans@gmail.com>
|
||||||
|
|
||||||
|
* gst/playback/gstdecodebin.c: (type_found),
|
||||||
|
(gst_decode_bin_change_state):
|
||||||
|
* gst/playback/gstdecodebin2.c: (type_found),
|
||||||
|
(gst_decode_bin_change_state):
|
||||||
|
Don't disconnect the have_type signal because we never reconnect it
|
||||||
|
later on. Instead keep a variable to see if we already detected a type.
|
||||||
|
|
||||||
2007-10-08 Wim Taymans <wim.taymans@gmail.com>
|
2007-10-08 Wim Taymans <wim.taymans@gmail.com>
|
||||||
|
|
||||||
* gst/playback/gstdecodebin.c: (add_fakesink), (type_found):
|
* gst/playback/gstdecodebin.c: (add_fakesink), (type_found):
|
||||||
|
|
|
@ -71,6 +71,7 @@ struct _GstDecodeBin
|
||||||
gint numpads;
|
gint numpads;
|
||||||
gint numwaiting;
|
gint numwaiting;
|
||||||
|
|
||||||
|
gboolean have_type;
|
||||||
guint have_type_id; /* signal id for the typefind element */
|
guint have_type_id; /* signal id for the typefind element */
|
||||||
|
|
||||||
gboolean shutting_down; /* stop pluggin if we're shutting down */
|
gboolean shutting_down; /* stop pluggin if we're shutting down */
|
||||||
|
@ -1538,13 +1539,14 @@ type_found (GstElement * typefind, guint probability, GstCaps * caps,
|
||||||
|
|
||||||
GST_STATE_LOCK (decode_bin);
|
GST_STATE_LOCK (decode_bin);
|
||||||
if (decode_bin->shutting_down)
|
if (decode_bin->shutting_down)
|
||||||
goto shutting_down;
|
goto exit;
|
||||||
|
|
||||||
/* don't need the typefind anymore, we're not going to dynamically change
|
/* don't need the typefind anymore if we already found a type, we're not going
|
||||||
* elements anyway */
|
* to be able to do anything with it anyway except for generating errors */
|
||||||
if (decode_bin->have_type_id)
|
if (decode_bin->have_type)
|
||||||
g_signal_handler_disconnect (G_OBJECT (typefind), decode_bin->have_type_id);
|
goto exit;
|
||||||
decode_bin->have_type_id = 0;
|
|
||||||
|
decode_bin->have_type = TRUE;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (decode_bin, "typefind found caps %" GST_PTR_FORMAT, caps);
|
GST_DEBUG_OBJECT (decode_bin, "typefind found caps %" GST_PTR_FORMAT, caps);
|
||||||
|
|
||||||
|
@ -1558,7 +1560,7 @@ type_found (GstElement * typefind, guint probability, GstCaps * caps,
|
||||||
GST_ELEMENT_ERROR (decode_bin, STREAM, WRONG_TYPE,
|
GST_ELEMENT_ERROR (decode_bin, STREAM, WRONG_TYPE,
|
||||||
(_("This appears to be a text file")),
|
(_("This appears to be a text file")),
|
||||||
("decodebin cannot decode plain text files"));
|
("decodebin cannot decode plain text files"));
|
||||||
goto shutting_down;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* autoplug the new pad with the caps that the signal gave us. */
|
/* autoplug the new pad with the caps that the signal gave us. */
|
||||||
|
@ -1577,7 +1579,7 @@ type_found (GstElement * typefind, guint probability, GstCaps * caps,
|
||||||
GST_DEBUG_OBJECT (decode_bin, "we have more dynamic elements");
|
GST_DEBUG_OBJECT (decode_bin, "we have more dynamic elements");
|
||||||
}
|
}
|
||||||
|
|
||||||
shutting_down:
|
exit:
|
||||||
GST_STATE_UNLOCK (decode_bin);
|
GST_STATE_UNLOCK (decode_bin);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1710,6 +1712,7 @@ gst_decode_bin_change_state (GstElement * element, GstStateChange transition)
|
||||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||||
GST_OBJECT_LOCK (decode_bin);
|
GST_OBJECT_LOCK (decode_bin);
|
||||||
decode_bin->shutting_down = FALSE;
|
decode_bin->shutting_down = FALSE;
|
||||||
|
decode_bin->have_type = FALSE;
|
||||||
GST_OBJECT_UNLOCK (decode_bin);
|
GST_OBJECT_UNLOCK (decode_bin);
|
||||||
|
|
||||||
if (!add_fakesink (decode_bin))
|
if (!add_fakesink (decode_bin))
|
||||||
|
|
|
@ -96,6 +96,7 @@ struct _GstDecodeBin
|
||||||
|
|
||||||
GList *factories; /* factories we can use for selecting elements */
|
GList *factories; /* factories we can use for selecting elements */
|
||||||
|
|
||||||
|
gboolean have_type; /* if we received the have_type signal */
|
||||||
guint have_type_id; /* signal id for have-type from typefind */
|
guint have_type_id; /* signal id for have-type from typefind */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1146,9 +1147,12 @@ type_found (GstElement * typefind, guint probability,
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (decode_bin, "typefind found caps %" GST_PTR_FORMAT, caps);
|
GST_DEBUG_OBJECT (decode_bin, "typefind found caps %" GST_PTR_FORMAT, caps);
|
||||||
|
|
||||||
if (decode_bin->have_type_id)
|
/* we can only deal with one type, we don't yet support dynamically changing
|
||||||
g_signal_handler_disconnect (typefind, decode_bin->have_type_id);
|
* caps from the typefind element */
|
||||||
decode_bin->have_type_id = 0;
|
if (decode_bin->have_type)
|
||||||
|
goto exit;
|
||||||
|
|
||||||
|
decode_bin->have_type = TRUE;
|
||||||
|
|
||||||
pad = gst_element_get_static_pad (typefind, "src");
|
pad = gst_element_get_static_pad (typefind, "src");
|
||||||
|
|
||||||
|
@ -1156,6 +1160,7 @@ type_found (GstElement * typefind, guint probability,
|
||||||
|
|
||||||
gst_object_unref (pad);
|
gst_object_unref (pad);
|
||||||
|
|
||||||
|
exit:
|
||||||
GST_STATE_UNLOCK (decode_bin);
|
GST_STATE_UNLOCK (decode_bin);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2190,6 +2195,7 @@ gst_decode_bin_change_state (GstElement * element, GstStateChange transition)
|
||||||
goto missing_typefind;
|
goto missing_typefind;
|
||||||
break;
|
break;
|
||||||
case GST_STATE_CHANGE_READY_TO_PAUSED:{
|
case GST_STATE_CHANGE_READY_TO_PAUSED:{
|
||||||
|
dbin->have_type = FALSE;
|
||||||
if (!add_fakesink (dbin))
|
if (!add_fakesink (dbin))
|
||||||
goto missing_fakesink;
|
goto missing_fakesink;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue