diff options
author | Stefan Sauer <ensonic@users.sf.net> | 2017-10-02 16:26:33 +0200 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2017-10-02 13:58:04 -0400 |
commit | 21c3f0ff226150cf83663fe507b502800744461a (patch) | |
tree | bde589c40dff49324f8a9fae410b32b4331568aa /plugins | |
parent | 944758aeda2e7a358152add433ab2808f9e3a705 (diff) |
tee: don't create a pool if none is needed
If the aggregated size is 0 and we create a pool, the pool would provide
buffers with no memory assigned. Handle that case and skip the pool.
This was the behaviour before cf803ea9f4e3fde92c1da86ecc47444035f7c0a7.
Add a test for this scenario.
https://bugzilla.gnome.org/show_bug.cgi?id=730758
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/elements/gsttee.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/elements/gsttee.c b/plugins/elements/gsttee.c index bc38b6b4b..b4aeb081c 100644 --- a/plugins/elements/gsttee.c +++ b/plugins/elements/gsttee.c @@ -797,9 +797,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); } |