In some cases, set_format() may get called twice before the output
format is set. Running an allocation query in this case is both not
needed and will cause assertion due tot he NULL caps.
* block. */
{
GstCaps *caps = gst_pad_get_current_caps (decoder->srcpad);
- GstQuery *query = gst_query_new_allocation (caps, FALSE);
- gst_pad_peer_query (decoder->srcpad, query);
- gst_query_unref (query);
- gst_caps_unref (caps);
+ if (caps) {
+ GstQuery *query = gst_query_new_allocation (caps, FALSE);
+ gst_pad_peer_query (decoder->srcpad, query);
+ gst_query_unref (query);
+ gst_caps_unref (caps);
+ }
}
gst_v4l2_object_stop (self->v4l2capture);