Browse Source

lavd/xv: report if no adaptor present.

Nicolas George 11 years ago
parent
commit
fde219cfa8
1 changed files with 4 additions and 0 deletions
  1. 4 0
      libavdevice/xv.c

+ 4 - 0
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);