comparison libvo/vo_aa.c @ 36759:8f3dc4467047

vo_aa: Move variables to appropriate scope, remove unused ones.
author reimar
date Sun, 16 Feb 2014 15:44:31 +0000
parents dc06b09d02a4
children
comparison
equal deleted inserted replaced
36758:0fa1993a31c3 36759:8f3dc4467047
666 } 666 }
667 667
668 static int preinit(const char *arg) 668 static int preinit(const char *arg)
669 { 669 {
670 char * hidis = NULL; 670 char * hidis = NULL;
671 struct stat sbuf;
672 int fd, vt, major, minor;
673 FILE * fp;
674 char fname[12];
675 671
676 if(arg) 672 if(arg)
677 { 673 {
678 if (parse_suboptions(arg) != 0) 674 if (parse_suboptions(arg) != 0)
679 return ENOSYS; 675 return ENOSYS;
681 677
682 /* initializing of aalib */ 678 /* initializing of aalib */
683 679
684 hidis=aa_getfirst(&aa_displayrecommended); 680 hidis=aa_getfirst(&aa_displayrecommended);
685 if ( hidis==NULL ){ 681 if ( hidis==NULL ){
682 struct stat sbuf;
683 char fname[12];
684 FILE *fp;
685 int fd, vt;
686 /* check /dev/vcsa<vt> */ 686 /* check /dev/vcsa<vt> */
687 /* check only, if no driver is explicit set */ 687 /* check only, if no driver is explicit set */
688 fd = dup (fileno (stderr)); 688 fd = dup (fileno (stderr));
689 fstat (fd, &sbuf); 689 fstat (fd, &sbuf);
690 major = sbuf.st_rdev >> 8; 690 // vt number stored in device minor
691 vt = minor = sbuf.st_rdev & 0xff; 691 vt = sbuf.st_rdev & 0xff;
692 close (fd); 692 close (fd);
693 sprintf (fname, "/dev/vcsa%2.2i", vt); 693 sprintf (fname, "/dev/vcsa%2.2i", vt);
694 fp = fopen (fname, "w+"); 694 fp = fopen (fname, "w+");
695 if (fp==NULL){ 695 if (fp==NULL){
696 fprintf(stderr,"VO: [aa] cannot open %s for writing," 696 fprintf(stderr,"VO: [aa] cannot open %s for writing,"