Mercurial > mplayer.hg
comparison libvo/font_load.c @ 19386:01853e915882
Make path separator for font path a define and set it to a better value for AMIGAOS
author | reimar |
---|---|
date | Mon, 14 Aug 2006 14:13:53 +0000 |
parents | ed69754aa58d |
children | 4186a45ce6c8 |
comparison
equal
deleted
inserted
replaced
19385:74fc1ab46daa | 19386:01853e915882 |
---|---|
158 desc->fpath=strdup(p[0]); | 158 desc->fpath=strdup(p[0]); |
159 continue; | 159 continue; |
160 } | 160 } |
161 } else | 161 } else |
162 | 162 |
163 #ifdef SYS_AMIGAOS4 | |
164 #define FONT_PATH_SEP "" | |
165 #else | |
166 //! path seperator for font paths, may not be more than one character | |
167 #define FONT_PATH_SEP "/" | |
168 #endif | |
169 | |
163 if(strcmp(section,"[files]")==0){ | 170 if(strcmp(section,"[files]")==0){ |
164 char *default_dir=MPLAYER_DATADIR "/font"; | 171 char *default_dir=MPLAYER_DATADIR FONT_PATH_SEP "font"; |
165 if(pdb==2 && strcmp(p[0],"alpha")==0){ | 172 if(pdb==2 && strcmp(p[0],"alpha")==0){ |
166 char *cp; | 173 char *cp; |
167 if (!(cp=malloc(strlen(desc->fpath)+strlen(p[1])+2))) goto fail_out; | 174 if (!(cp=malloc(strlen(desc->fpath)+strlen(p[1])+2))) goto fail_out; |
168 | 175 |
169 snprintf(cp,strlen(desc->fpath)+strlen(p[1])+2,"%s/%s", | 176 snprintf(cp,strlen(desc->fpath)+strlen(p[1])+2,"%s" FONT_PATH_SEP "%s", |
170 desc->fpath,p[1]); | 177 desc->fpath,p[1]); |
171 if(!((desc->pic_a[fontdb]=load_raw(cp,verbose)))){ | 178 if(!((desc->pic_a[fontdb]=load_raw(cp,verbose)))){ |
172 free(cp); | 179 free(cp); |
173 if (!(cp=malloc(strlen(default_dir)+strlen(p[1])+2))) | 180 if (!(cp=malloc(strlen(default_dir)+strlen(p[1])+2))) |
174 goto fail_out; | 181 goto fail_out; |
175 snprintf(cp,strlen(default_dir)+strlen(p[1])+2,"%s/%s", | 182 snprintf(cp,strlen(default_dir)+strlen(p[1])+2,"%s" FONT_PATH_SEP "%s", |
176 default_dir,p[1]); | 183 default_dir,p[1]); |
177 if (!((desc->pic_a[fontdb]=load_raw(cp,verbose)))){ | 184 if (!((desc->pic_a[fontdb]=load_raw(cp,verbose)))){ |
178 mp_msg(MSGT_OSD, MSGL_ERR, "Can't load font bitmap: %s\n",p[1]); | 185 mp_msg(MSGT_OSD, MSGL_ERR, "Can't load font bitmap: %s\n",p[1]); |
179 free(cp); | 186 free(cp); |
180 goto fail_out; | 187 goto fail_out; |
185 } | 192 } |
186 if(pdb==2 && strcmp(p[0],"bitmap")==0){ | 193 if(pdb==2 && strcmp(p[0],"bitmap")==0){ |
187 char *cp; | 194 char *cp; |
188 if (!(cp=malloc(strlen(desc->fpath)+strlen(p[1])+2))) goto fail_out; | 195 if (!(cp=malloc(strlen(desc->fpath)+strlen(p[1])+2))) goto fail_out; |
189 | 196 |
190 snprintf(cp,strlen(desc->fpath)+strlen(p[1])+2,"%s/%s", | 197 snprintf(cp,strlen(desc->fpath)+strlen(p[1])+2,"%s" FONT_PATH_SEP "%s", |
191 desc->fpath,p[1]); | 198 desc->fpath,p[1]); |
192 if(!((desc->pic_b[fontdb]=load_raw(cp,verbose)))){ | 199 if(!((desc->pic_b[fontdb]=load_raw(cp,verbose)))){ |
193 free(cp); | 200 free(cp); |
194 if (!(cp=malloc(strlen(default_dir)+strlen(p[1])+2))) | 201 if (!(cp=malloc(strlen(default_dir)+strlen(p[1])+2))) |
195 goto fail_out; | 202 goto fail_out; |
196 snprintf(cp,strlen(default_dir)+strlen(p[1])+2,"%s/%s", | 203 snprintf(cp,strlen(default_dir)+strlen(p[1])+2,"%s" FONT_PATH_SEP "%s", |
197 default_dir,p[1]); | 204 default_dir,p[1]); |
198 if (!((desc->pic_b[fontdb]=load_raw(cp,verbose)))){ | 205 if (!((desc->pic_b[fontdb]=load_raw(cp,verbose)))){ |
199 mp_msg(MSGT_OSD, MSGL_ERR, "Can't load font bitmap: %s\n",p[1]); | 206 mp_msg(MSGT_OSD, MSGL_ERR, "Can't load font bitmap: %s\n",p[1]); |
200 free(cp); | 207 free(cp); |
201 goto fail_out; | 208 goto fail_out; |