diff options
author | Hyunjun Ko <zzoon@igalia.com> | 2016-12-15 15:59:30 +0900 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> | 2017-02-01 20:01:11 +0100 |
commit | a5650e8dc3e0424eb391a96a0fc7c871c27c61f3 (patch) | |
tree | 2e534da81f4c65add3854fac7dd8bf2cd7518176 /gst-libs | |
parent | 65c16145a59f603b340540eb97fc21aa9ba61ce7 (diff) |
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
Diffstat (limited to 'gst-libs')
-rw-r--r-- | gst-libs/gst/vaapi/gstvaapiutils_core.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiutils_core.c b/gst-libs/gst/vaapi/gstvaapiutils_core.c index 42ebaff1..e1e76b81 100644 --- a/gst-libs/gst/vaapi/gstvaapiutils_core.c +++ b/gst-libs/gst/vaapi/gstvaapiutils_core.c @@ -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; - } |