vaapivideocontext: context type can be rejected

Instead of calling g_return_val_if_fail() to check the context type, we
should use a normal conditional, since it is possible that other context types
can arrive and try to be assigned. Otherwise a critical log message is
printed.

This happens when we use playbin3 with vaapipostproc as video-filter.

https://bugzilla.gnome.org/show_bug.cgi?id=777409
This commit is contained in:
Víctor Manuel Jáquez Leal 2016-08-02 15:48:25 +02:00
parent 26fa4df958
commit 43d4f0bfb5

View file

@ -73,10 +73,13 @@ gst_vaapi_video_context_get_display (GstContext * context,
GstVaapiDisplay ** display_ptr)
{
const GstStructure *structure;
const gchar *type;
g_return_val_if_fail (GST_IS_CONTEXT (context), FALSE);
g_return_val_if_fail (g_strcmp0 (gst_context_get_context_type (context),
GST_VAAPI_DISPLAY_CONTEXT_TYPE_NAME) == 0, FALSE);
type = gst_context_get_context_type (context);
if (g_strcmp0 (type, GST_VAAPI_DISPLAY_CONTEXT_TYPE_NAME))
return FALSE;
structure = gst_context_get_structure (context);
return gst_structure_get (structure, GST_VAAPI_DISPLAY_CONTEXT_TYPE_NAME,