plugins: simplify gst_vaapi_ensure_display().

Return earlier if the creation of a VA display failed. Likewise, simplify
gst_vaapi_video_context_propagate() now that we are guaranteed to have a
valid VA display.
This commit is contained in:
Gwenole Beauchesne 2013-11-29 13:56:12 +01:00
parent 84b3f84925
commit 16751205a2
2 changed files with 4 additions and 9 deletions

View file

@ -139,12 +139,12 @@ gst_vaapi_ensure_display(
/* If no neighboor, or application not interested, use system default */
display = gst_vaapi_create_display(&display_type);
if (display_ptr)
*display_ptr = display;
if (!display)
return FALSE;
gst_vaapi_video_context_propagate(context, display);
return display != NULL;
*display_ptr = display;
return TRUE;
}
void

View file

@ -169,11 +169,6 @@ gst_vaapi_video_context_propagate(GstElement *element, GstVaapiDisplay *display)
GstContext *context;
GstMessage *msg;
if (!display) {
GST_ERROR_OBJECT(element, "failed to get VA-API display connection");
return;
}
context = gst_vaapi_video_context_new_with_display(display, FALSE);
GST_CAT_INFO_OBJECT(GST_CAT_CONTEXT, element,