--- camserv/video_fbsd_bttv.c.orig	Mon May 12 23:13:31 2003
+++ camserv/video_fbsd_bttv.c	Mon May 12 23:13:00 2003
@@ -27,6 +27,7 @@
 #include <fcntl.h>
 #include <errno.h>
 #include <sys/mman.h>
+#include <sys/types.h>
 #include <machine/ioctl_bt848.h>
 #include <machine/ioctl_meteor.h>
 #include <signal.h>
@@ -644,7 +644,7 @@
   if( !fbttv_dev->autobright || --fbttv_dev->autoleft > 0 )
     return 0;
 
   totmean = camserv_get_pic_mean( width, height, picbuf, 1, 0, 0, 
-				  width, height );
+				  width-1, height-1 );
   if( totmean < (256 / 2) - 10 || totmean > (256 / 2) + 10 ) {
     newbright = fbttv_dev->brightness;
     if( totmean > (256 / 2) + 10 ){
