From 16751205a26f138396ded661227cc99c146572d1 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Fri, 29 Nov 2013 13:56:12 +0100 Subject: [PATCH] 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. --- gst/vaapi/gstvaapipluginutil.c | 8 ++++---- gst/vaapi/gstvaapivideocontext.c | 5 ----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/gst/vaapi/gstvaapipluginutil.c b/gst/vaapi/gstvaapipluginutil.c index 82349a8..92f9ec5 100644 --- a/gst/vaapi/gstvaapipluginutil.c +++ b/gst/vaapi/gstvaapipluginutil.c @@ -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 diff --git a/gst/vaapi/gstvaapivideocontext.c b/gst/vaapi/gstvaapivideocontext.c index e740983..551b79d 100644 --- a/gst/vaapi/gstvaapivideocontext.c +++ b/gst/vaapi/gstvaapivideocontext.c @@ -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, -- 2.7.4