X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=plugins%2Felements%2Fgsttee.c;h=0ff7527d488fb3f9f3e2c67424a9773546ac417d;hb=44623cacd637efb8f6cf93512238cdad575b9f60;hp=bc38b6b4ba12b8f840d5537786f960a8a55b46e6;hpb=1cd0dd3503c141954ba0740cc5eca6676af9c028;p=platform%2Fupstream%2Fgstreamer.git diff --git a/plugins/elements/gsttee.c b/plugins/elements/gsttee.c index bc38b6b..0ff7527 100644 --- a/plugins/elements/gsttee.c +++ b/plugins/elements/gsttee.c @@ -460,12 +460,8 @@ gst_tee_release_pad (GstElement * element, GstPad * pad) } GST_OBJECT_UNLOCK (tee); - gst_object_ref (pad); - gst_element_remove_pad (GST_ELEMENT_CAST (tee), pad); - gst_pad_set_active (pad, FALSE); - - gst_object_unref (pad); + gst_element_remove_pad (GST_ELEMENT_CAST (tee), pad); if (changed) { gst_tee_notify_alloc_pad (tee); @@ -624,7 +620,7 @@ gst_tee_query_allocation (const GValue * item, GValue * ret, gpointer user_data) gst_object_unref (peer_pad); /* Allocation Params: - * store the maximum alignment, prefix and pading, but ignore the + * store the maximum alignment, prefix and padding, but ignore the * allocators and the flags which are tied to downstream allocation */ count = gst_query_get_n_allocation_params (query); for (i = 0; i < count; i++) { @@ -797,9 +793,16 @@ gst_tee_sink_query (GstPad * pad, GstObject * parent, GstQuery * query) if (ctx.num_pads > 1) ctx.min_buffers++; - gst_query_add_allocation_param (ctx.query, NULL, &ctx.params); - gst_query_add_allocation_pool (ctx.query, NULL, ctx.size, - ctx.min_buffers, 0); + /* Check that we actually have parameters besides the defaults. */ + if (ctx.params.align || ctx.params.prefix || ctx.params.padding) { + gst_query_add_allocation_param (ctx.query, NULL, &ctx.params); + } + /* When size == 0, buffers created from this pool would have no memory + * allocated. */ + if (ctx.size) { + gst_query_add_allocation_pool (ctx.query, NULL, ctx.size, + ctx.min_buffers, 0); + } } else { gst_tee_clear_query_allocation_meta (query); } @@ -892,12 +895,14 @@ gst_tee_handle_data (GstTee * tee, gpointer data, gboolean is_list) ret = gst_pad_push (pad, GST_BUFFER_CAST (data)); } + GST_OBJECT_LOCK (tee); if (GST_TEE_PAD_CAST (pad)->removed) ret = GST_FLOW_NOT_LINKED; if (ret == GST_FLOW_NOT_LINKED && tee->allow_not_linked) { ret = GST_FLOW_OK; } + GST_OBJECT_UNLOCK (tee); gst_object_unref (pad); @@ -936,6 +941,8 @@ restart: GST_OBJECT_LOCK (tee); /* keep track of which pad we pushed and the result value */ + if (GST_TEE_PAD_CAST (pad)->removed) + ret = GST_FLOW_NOT_LINKED; GST_TEE_PAD_CAST (pad)->pushed = TRUE; GST_TEE_PAD_CAST (pad)->result = ret; gst_object_unref (pad);