[Mplayer-cvslog] CVS: main/libvo font_load.c,1.20,1.21
Adam Tla/lka
atlka at mplayer.dev.hu
Wed Oct 17 17:15:42 CEST 2001
Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv4868/libvo
Modified Files:
font_load.c
Log Message:
if not found using fpath try to load font bitmaps from default dir
Index: font_load.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/font_load.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- font_load.c 16 Oct 2001 12:50:59 -0000 1.20
+++ font_load.c 17 Oct 2001 15:15:30 -0000 1.21
@@ -139,6 +139,7 @@
} else
if(strcmp(section,"[files]")==0){
+ char *default_dir=DATADIR"/font";
if(pdb==2 && strcmp(p[0],"alpha")==0){
char *cp;
if (!(cp=malloc(strlen(desc->fpath)+strlen(p[1])+2))) return NULL;
@@ -146,9 +147,16 @@
snprintf(cp,strlen(desc->fpath)+strlen(p[1])+2,"%s/%s",
desc->fpath,p[1]);
if(!((desc->pic_a[fontdb]=load_raw(cp,verbose)))){
- printf("Can't load font bitmap: %s\n",p[1]);
free(cp);
- return NULL;
+ if (!(cp=malloc(strlen(default_dir)+strlen(p[1])+2)))
+ return NULL;
+ snprintf(cp,strlen(default_dir)+strlen(p[1])+2,"%s/%s",
+ default_dir,p[1]);
+ if (!((desc->pic_a[fontdb]=load_raw(cp,verbose)))){
+ printf("Can't load font bitmap: %s\n",p[1]);
+ free(cp);
+ return NULL;
+ }
}
free(cp);
continue;
@@ -160,9 +168,16 @@
snprintf(cp,strlen(desc->fpath)+strlen(p[1])+2,"%s/%s",
desc->fpath,p[1]);
if(!((desc->pic_b[fontdb]=load_raw(cp,verbose)))){
- printf("Can't load font bitmap: %s\n",p[1]);
free(cp);
- return NULL;
+ if (!(cp=malloc(strlen(default_dir)+strlen(p[1])+2)))
+ return NULL;
+ snprintf(cp,strlen(default_dir)+strlen(p[1])+2,"%s/%s",
+ default_dir,p[1]);
+ if (!((desc->pic_b[fontdb]=load_raw(cp,verbose)))){
+ printf("Can't load font bitmap: %s\n",p[1]);
+ free(cp);
+ return NULL;
+ }
}
free(cp);
continue;
More information about the MPlayer-cvslog
mailing list