libs: utils: return NULL if failed to get surface formats

Thus, when generating the allowed caps, the element will throw a
warning and it will use its caps template.

This behavior might be a bug in the VA driver.

https://bugzilla.gnome.org/show_bug.cgi?id=775490
This commit is contained in:
Hyunjun Ko 2016-12-15 15:59:30 +09:00 committed by Víctor Manuel Jáquez Leal
parent 65c16145a5
commit a5650e8dc3

View file

@ -139,6 +139,11 @@ gst_vaapi_get_surface_formats (GstVaapiDisplay * display, VAConfigID config)
g_array_append_val (formats, fmt);
}
if (formats->len == 0) {
g_array_unref (formats);
formats = NULL;
}
g_free (surface_attribs);
return formats;
@ -149,5 +154,4 @@ error:
}
#endif
return NULL;
}