mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
plugins/elements/gsttee.c: Check for changed pads-list before checking the last returned
Original commit message from CVS: * plugins/elements/gsttee.c: (gst_tee_handle_buffer): Check for changed pads-list before checking the last returned GstFlowReturn because the pad could have been removed and we need to ignore the value in that case.
This commit is contained in:
parent
b90bef8ee5
commit
55eff82256
2 changed files with 19 additions and 8 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2008-12-08 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
|
* plugins/elements/gsttee.c: (gst_tee_handle_buffer):
|
||||||
|
Check for changed pads-list before checking the last returned
|
||||||
|
GstFlowReturn because the pad could have been removed and we
|
||||||
|
need to ignore the value in that case.
|
||||||
|
|
||||||
2008-12-08 Wim Taymans <wim.taymans@collabora.co.uk>
|
2008-12-08 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
* libs/gst/base/gstbasetransform.c:
|
* libs/gst/base/gstbasetransform.c:
|
||||||
|
|
|
@ -593,6 +593,18 @@ restart:
|
||||||
GST_LOG_OBJECT (tee, "pad already pushed with %s",
|
GST_LOG_OBJECT (tee, "pad already pushed with %s",
|
||||||
gst_flow_get_name (ret));
|
gst_flow_get_name (ret));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* before we go combining the return value, check if the pad list is still
|
||||||
|
* the same. It could be possible that the pad we just pushed was removed
|
||||||
|
* and the return value it not valid anymore */
|
||||||
|
if (GST_ELEMENT_CAST (tee)->pads_cookie != cookie) {
|
||||||
|
GST_LOG_OBJECT (tee, "pad list changed");
|
||||||
|
/* the list of pads changed, restart iteration. Pads that we already
|
||||||
|
* pushed on and are still in the new list, will not be pushed on
|
||||||
|
* again. */
|
||||||
|
goto restart;
|
||||||
|
}
|
||||||
|
|
||||||
/* stop pushing more buffers when we have a fatal error */
|
/* stop pushing more buffers when we have a fatal error */
|
||||||
if (ret != GST_FLOW_OK && ret != GST_FLOW_NOT_LINKED)
|
if (ret != GST_FLOW_OK && ret != GST_FLOW_NOT_LINKED)
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -602,14 +614,6 @@ restart:
|
||||||
GST_LOG_OBJECT (tee, "Replacing ret val %d with %d", cret, ret);
|
GST_LOG_OBJECT (tee, "Replacing ret val %d with %d", cret, ret);
|
||||||
cret = ret;
|
cret = ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GST_ELEMENT_CAST (tee)->pads_cookie != cookie) {
|
|
||||||
GST_LOG_OBJECT (tee, "pad list changed");
|
|
||||||
/* the list of pads changed, restart iteration. Pads that we already
|
|
||||||
* pushed on and are still in the new list, will not be pushed on
|
|
||||||
* again. */
|
|
||||||
goto restart;
|
|
||||||
}
|
|
||||||
pads = g_list_next (pads);
|
pads = g_list_next (pads);
|
||||||
}
|
}
|
||||||
GST_OBJECT_UNLOCK (tee);
|
GST_OBJECT_UNLOCK (tee);
|
||||||
|
|
Loading…
Reference in a new issue