GNOME Bugzilla – Bug 647857
[xvimagesink/ximagesink] Handle NULL caps in buffer_alloc()
Last modified: 2011-04-18 09:27:17 UTC
See attached patch. Elements are currently assuming that the caps are not NULL and fixed and will explode otherwise, for example xvimagesink (see bug #647854). Another solution would be, to use GST_PAD_CAPS() if NULL is passed and if GST_PAD_CAPS() is not NULL, I'll attach a patch for this too.
Created attachment 186015 [details] [review] pad: Check if valid caps are passed to gst_pad_alloc_buffer()
No, I won't attach a patch for the second solution. IMHO the attached patch is the right thing to do and using GST_PAD_CAPS() will make the code ugly (need to take a ref of the caps and only unref them if GST_PAD_CAPS was used later).
Comment on attachment 186015 [details] [review] pad: Check if valid caps are passed to gst_pad_alloc_buffer() NULL caps need to be allowed because of elements that don't need any caps, like filesrc/fakesink
commit 75c337c72607892129de7f765c7410e8b7eec131 Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Mon Apr 18 11:24:57 2011 +0200 x(v)imagesink: If NULL caps are passed to buffer_alloc() do fallback allocation Fixes bug #647857.