diff options
Diffstat (limited to 'libavutil/hwcontext_vaapi.c')
-rw-r--r-- | libavutil/hwcontext_vaapi.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index 38bdeb7820..b576447407 100644 --- a/libavutil/hwcontext_vaapi.c +++ b/libavutil/hwcontext_vaapi.c @@ -1677,20 +1677,22 @@ static int vaapi_device_derive(AVHWDeviceContext *ctx, } else { render_node = drmGetRenderDeviceNameFromFd(src_hwctx->fd); if (!render_node) { - av_log(ctx, AV_LOG_ERROR, "Failed to find a render node " - "matching the DRM device.\n"); - return AVERROR(ENODEV); - } - fd = open(render_node, O_RDWR); - if (fd < 0) { - av_log(ctx, AV_LOG_ERROR, "Failed to open render node %s" - "matching the DRM device.\n", render_node); + av_log(ctx, AV_LOG_VERBOSE, "Using non-render node " + "because no associated render node was found.\n"); + fd = src_hwctx->fd; + } else { + fd = open(render_node, O_RDWR); + if (fd < 0) { + av_log(ctx, AV_LOG_VERBOSE, "Using non-render node " + "because render node failed to open.\n"); + fd = src_hwctx->fd; + } else { + av_log(ctx, AV_LOG_VERBOSE, "Using render node %s " + "in place of non-render DRM device.\n", + render_node); + } free(render_node); - return AVERROR(errno); } - av_log(ctx, AV_LOG_VERBOSE, "Using render node %s in place " - "of non-render DRM device.\n", render_node); - free(render_node); } } #else |