mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 02:01:12 +00:00
gst/: Set pads to FLUSHING when they are created. Check, warn and fix when a demuxer adds an inactive pad to itself w...
Original commit message from CVS: * gst/gstelement.c: (gst_element_add_pad): * gst/gstghostpad.c: (gst_ghost_pad_new_full): * gst/gstpad.c: (gst_pad_init): Set pads to FLUSHING when they are created. Check, warn and fix when a demuxer adds an inactive pad to itself when running. Fixes #339326.
This commit is contained in:
parent
0ad3d72cf5
commit
1affbe8e9f
4 changed files with 22 additions and 6 deletions
|
@ -1,3 +1,11 @@
|
|||
2006-12-15 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* gst/gstelement.c: (gst_element_add_pad):
|
||||
* gst/gstghostpad.c: (gst_ghost_pad_new_full):
|
||||
* gst/gstpad.c: (gst_pad_init):
|
||||
Set pads to FLUSHING when they are created. Check, warn and fix when a
|
||||
demuxer adds an inactive pad to itself when running. Fixes #339326.
|
||||
|
||||
2006-12-15 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* gst/gstelement.c: (gst_element_class_init),
|
||||
|
|
|
@ -612,6 +612,7 @@ gboolean
|
|||
gst_element_add_pad (GstElement * element, GstPad * pad)
|
||||
{
|
||||
gchar *pad_name;
|
||||
gboolean flushing;
|
||||
|
||||
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
|
||||
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
|
||||
|
@ -621,6 +622,7 @@ gst_element_add_pad (GstElement * element, GstPad * pad)
|
|||
pad_name = g_strdup (GST_PAD_NAME (pad));
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_ELEMENT_PADS, element, "adding pad '%s'",
|
||||
GST_STR_NULL (pad_name));
|
||||
flushing = GST_PAD_IS_FLUSHING (pad);
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
|
||||
/* then check to see if there's already a pad by that name here */
|
||||
|
@ -633,6 +635,17 @@ gst_element_add_pad (GstElement * element, GstPad * pad)
|
|||
GST_OBJECT_CAST (element))))
|
||||
goto had_parent;
|
||||
|
||||
/* check for flushing pads */
|
||||
if (flushing && (GST_STATE (element) > GST_STATE_READY ||
|
||||
GST_STATE_NEXT (element) == GST_STATE_PAUSED)) {
|
||||
g_warning ("adding flushing pad '%s' to running element '%s'",
|
||||
GST_STR_NULL (pad_name), GST_ELEMENT_NAME (element));
|
||||
/* unset flushing */
|
||||
GST_OBJECT_LOCK (pad);
|
||||
GST_PAD_UNSET_FLUSHING (pad);
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
}
|
||||
|
||||
g_free (pad_name);
|
||||
|
||||
/* add it to the list */
|
||||
|
|
|
@ -833,7 +833,7 @@ gst_ghost_pad_new_full (const gchar * name, GstPadDirection dir,
|
|||
g_object_new (GST_TYPE_PROXY_PAD, "name", NULL,
|
||||
"direction", otherdir, NULL);
|
||||
}
|
||||
/* GST_PAD_UNSET_FLUSHING (internal); */
|
||||
GST_PAD_UNSET_FLUSHING (internal);
|
||||
|
||||
/* Set directional padfunctions for internal pad */
|
||||
if (dir == GST_PAD_SRC) {
|
||||
|
|
|
@ -352,12 +352,7 @@ gst_pad_init (GstPad * pad)
|
|||
pad->do_buffer_signals = 0;
|
||||
pad->do_event_signals = 0;
|
||||
|
||||
#if 0
|
||||
GST_PAD_SET_FLUSHING (pad);
|
||||
#else
|
||||
/* FIXME, should be set flushing initially, see #339326 */
|
||||
GST_PAD_UNSET_FLUSHING (pad);
|
||||
#endif
|
||||
|
||||
pad->preroll_lock = g_mutex_new ();
|
||||
pad->preroll_cond = g_cond_new ();
|
||||
|
|
Loading…
Reference in a new issue