[Mplayer-cvslog] CVS: main/libvo font_load.c,1.3,1.4

Gabor Lenart lgb at users.sourceforge.net
Mon Mar 26 19:16:30 CEST 2001


Update of /cvsroot/mplayer/main/libvo
In directory usw-pr-cvs1:/tmp/cvs-serv25382/main/libvo

Modified Files:
	font_load.c 
Log Message:
Search font files in ~/.mplayer/font/ instead of current dir

Index: font_load.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/font_load.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** font_load.c	2001/03/25 20:37:22	1.3
--- font_load.c	2001/03/26 17:16:27	1.4
***************
*** 6,9 ****
--- 6,11 ----
  #include "font_load.h"
  
+ char *get_path ( char * );
+ 
  raw_file* load_raw(char *name){
      int bpp;
***************
*** 108,122 ****
    if(strcmp(section,"[files]")==0){
        if(pdb==2 && strcmp(p[0],"alpha")==0){
!           if(!((desc->pic_a[fontdb]=load_raw(p[1])))){
                  printf("Can't load font bitmap: %s\n",p[1]);
                  return NULL;
            }
            continue;
        }
        if(pdb==2 && strcmp(p[0],"bitmap")==0){
!           if(!((desc->pic_b[fontdb]=load_raw(p[1])))){
                  printf("Can't load font bitmap: %s\n",p[1]);
                  return NULL;
            }
            continue;
        }
--- 110,138 ----
    if(strcmp(section,"[files]")==0){
        if(pdb==2 && strcmp(p[0],"alpha")==0){
!     	  char *cp=get_path("font/");
! 	  char *cp2=malloc(strlen(cp)+strlen(p[1])+1);
! 	  sprintf(cp2,"%s%s",cp,p[1]);
!           if(!((desc->pic_a[fontdb]=load_raw(cp2)))){
                  printf("Can't load font bitmap: %s\n",p[1]);
+ 		free(cp);
+ 		free(cp2);
                  return NULL;
            }
+ 	  free(cp);
+ 	  free(cp2);
            continue;
        }
        if(pdb==2 && strcmp(p[0],"bitmap")==0){
!     	  char *cp=get_path("font/");
! 	  char *cp2=malloc(strlen(cp)+strlen(p[1])+1);
! 	  sprintf(cp2,"%s%s",cp,p[1]);
!           if(!((desc->pic_b[fontdb]=load_raw(cp2)))){
                  printf("Can't load font bitmap: %s\n",p[1]);
+ 		free(cp);
+ 		free(cp2);
                  return NULL;
            }
+ 	  free(cp);
+ 	  free(cp2);
            continue;
        }


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list