[Mplayer-cvslog] CVS: main/libvo font_load.c,1.14,1.15 font_load.h,1.5,1.6

Arpi of Ize arpi at mplayer.dev.hu
Fri Jul 20 02:01:12 CEST 2001


Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv21748/libvo

Modified Files:
	font_load.c font_load.h 
Log Message:
Applied DATADIR patch by Vladimir Kushnir

Index: font_load.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/font_load.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- font_load.c	2 Jun 2001 16:01:58 -0000	1.14
+++ font_load.c	20 Jul 2001 00:01:09 -0000	1.15
@@ -110,41 +110,40 @@
       }
   }
   
+  if(strcmp(section,"[fpath]")==0){
+      if(pdb==1){
+          desc->fpath=strdup(p[0]);
+          continue;
+      }
+  } else    
+
   if(strcmp(section,"[files]")==0){
       if(pdb==2 && strcmp(p[0],"alpha")==0){
-    	  char *cp,*cp2;
-	  if (!(cp=get_path("font/"))) return NULL;
-	  if (!(cp2=malloc(strlen(cp)+strlen(p[1])+1))) {
-		free(cp);
-		return NULL;
-	  }
-	  sprintf(cp2,"%s%s",cp,p[1]);
-          if(!((desc->pic_a[fontdb]=load_raw(cp2,verbose)))){
+    	  char *cp;
+	  if (!(cp=malloc(strlen(desc->fpath)+strlen(p[1])+2))) return NULL;
+
+	  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);
-		free(cp2);
                 return NULL;
           }
 	  free(cp);
-	  free(cp2);
           continue;
       }
       if(pdb==2 && strcmp(p[0],"bitmap")==0){
-    	  char *cp,*cp2;
-	  if (!(cp=get_path("font/"))) return NULL;
-	  if (!(cp2=malloc(strlen(cp)+strlen(p[1])+1))) {
-		free(cp);
-		return NULL;
-	  }
-	  sprintf(cp2,"%s%s",cp,p[1]);
-          if(!((desc->pic_b[fontdb]=load_raw(cp2,verbose)))){
+    	  char *cp;
+	  if (!(cp=malloc(strlen(desc->fpath)+strlen(p[1])+2))) return NULL;
+
+	  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);
-		free(cp2);
                 return NULL;
           }
 	  free(cp);
-	  free(cp2);
           continue;
       }
   } else

Index: font_load.h
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/font_load.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- font_load.h	6 May 2001 02:26:17 -0000	1.5
+++ font_load.h	20 Jul 2001 00:01:09 -0000	1.6
@@ -7,6 +7,7 @@
 
 typedef struct {
     char *name;
+    char *fpath;
     int spacewidth;
     int charspace;
     int height;




More information about the MPlayer-cvslog mailing list