From fde219cfa8f6e823c770d57b2fa2a2799a5445e2 Mon Sep 17 00:00:00 2001 From: Nicolas George Date: Sun, 29 Dec 2013 11:29:18 +0100 Subject: [PATCH] lavd/xv: report if no adaptor present. --- libavdevice/xv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavdevice/xv.c b/libavdevice/xv.c index ad604825f2..a4b44c8eda 100644 --- a/libavdevice/xv.c +++ b/libavdevice/xv.c @@ -149,6 +149,10 @@ static int xv_write_header(AVFormatContext *s) ret = AVERROR_EXTERNAL; goto fail; } + if (!num_adaptors) { + av_log(s, AV_LOG_ERROR, "No X-Video adaptors present\n"); + return AVERROR(ENODEV); + } xv->xv_port = ai[0].base_id; XvFreeAdaptorInfo(ai);