In gst_vaapi_context_reset(), if the context has to be destroyed, make
sure to create it first before allocating its associated surfaces.
This patch fixes a regression introduced in commit 82872f4 because
the formats available in the current context now are ensured before
creating the context's surfaces.
https://bugzilla.gnome.org/show_bug.cgi?id=797277
if (reset_config)
context_destroy (context);
+ if (reset_config && !(config_create (context) && context_create (context)))
+ return FALSE;
if (reset_surfaces && !context_create_surfaces (context))
return FALSE;
else if (grow_surfaces && !context_ensure_surfaces (context))
return FALSE;
- if (reset_config && !(config_create (context) && context_create (context)))
- return FALSE;
return TRUE;
}