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 */ /* If no neighboor, or application not interested, use system default */
display = gst_vaapi_create_display(&display_type); display = gst_vaapi_create_display(&display_type);
if (!display)
if (display_ptr) return FALSE;
*display_ptr = display;
gst_vaapi_video_context_propagate(context, display); gst_vaapi_video_context_propagate(context, display);
return display != NULL; *display_ptr = display;
return TRUE;
} }
void void

View file

@ -169,11 +169,6 @@ gst_vaapi_video_context_propagate(GstElement *element, GstVaapiDisplay *display)
GstContext *context; GstContext *context;
GstMessage *msg; 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); context = gst_vaapi_video_context_new_with_display(display, FALSE);
GST_CAT_INFO_OBJECT(GST_CAT_CONTEXT, element, GST_CAT_INFO_OBJECT(GST_CAT_CONTEXT, element,