diff options
author | Julien Moutte <julien@moutte.net> | 2006-01-26 12:40:17 +0000 |
---|---|---|
committer | Julien Moutte <julien@moutte.net> | 2006-01-26 12:40:17 +0000 |
commit | 41a718c171cab576cca29b94b2b08caf12b31707 (patch) | |
tree | b387e7099eb5f83624d931180b6164a9b25c5f9e | |
parent | 9da007403061216cafeb5d742347335475446e1c (diff) | |
download | gstreamer-41a718c171cab576cca29b94b2b08caf12b31707.tar.gz |
plugins/elements/gsttee.c: Apply patch from #328715. Tee now handles pad being NOT_LINKED or in WRONG_STATE.
Original commit message from CVS:
2006-01-26 Julien MOUTTE <julien@moutte.net>
* plugins/elements/gsttee.c: (gst_tee_do_push),
(gst_tee_handle_buffer): Apply patch from #328715. Tee now
handles pad being NOT_LINKED or in WRONG_STATE.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | plugins/elements/gsttee.c | 11 |
2 files changed, 15 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2006-01-26 Julien MOUTTE <julien@moutte.net> + + * plugins/elements/gsttee.c: (gst_tee_do_push), + (gst_tee_handle_buffer): Apply patch from #328715. Tee now + handles pad being NOT_LINKED or in WRONG_STATE. + 2006-01-26 Stefan Kost <ensonic@users.sf.net> * win32/MANIFEST: diff --git a/plugins/elements/gsttee.c b/plugins/elements/gsttee.c index 811ac15aa6..e10e08aa6c 100644 --- a/plugins/elements/gsttee.c +++ b/plugins/elements/gsttee.c @@ -278,12 +278,18 @@ gst_tee_do_push (GstPad * pad, GValue * ret, PushData * data) g_object_notify (G_OBJECT (tee), "last_message"); } + /* Push */ res = gst_pad_push (pad, gst_buffer_ref (data->buffer)); - g_value_set_enum (ret, res); + + /* If it's fatal or OK we overwrite the previous value */ + if (GST_FLOW_IS_FATAL (res) || (res == GST_FLOW_OK)) { + g_value_set_enum (ret, res); + } gst_object_unref (pad); - return (res == GST_FLOW_OK); + /* Stop iterating if flow return is fatal */ + return (!GST_FLOW_IS_FATAL (res)); } static GstFlowReturn @@ -297,6 +303,7 @@ gst_tee_handle_buffer (GstTee * tee, GstBuffer * buffer) tee->offset += GST_BUFFER_SIZE (buffer); g_value_init (&ret, GST_TYPE_FLOW_RETURN); + g_value_set_enum (&ret, GST_FLOW_NOT_LINKED); iter = gst_element_iterate_src_pads (GST_ELEMENT (tee)); data.tee = tee; data.buffer = buffer; |