mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
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:
parent
84b3f84925
commit
16751205a2
2 changed files with 4 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue