From 41a718c171cab576cca29b94b2b08caf12b31707 Mon Sep 17 00:00:00 2001 From: Julien Moutte Date: Thu, 26 Jan 2006 12:40:17 +0000 Subject: [PATCH] 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 * 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. --- ChangeLog | 6 ++++++ plugins/elements/gsttee.c | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 931a45f9df..e0db514a3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-01-26 Julien MOUTTE + + * 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 * 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;