summaryrefslogtreecommitdiff
path: root/src/xine-engine/osd.c
diff options
context:
space:
mode:
authorDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2003-12-07 15:34:29 +0000
committerDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2003-12-07 15:34:29 +0000
commitc8fdff20285b59cd892297317572fbb4c3633f78 (patch)
tree102be6141b635eb2bff16358ca13b79924b211f4 /src/xine-engine/osd.c
parenta2dcf860b2777e530646abd00202c3fb5b3a5a81 (diff)
downloadxine-lib-c8fdff20285b59cd892297317572fbb4c3633f78.tar.gz
xine-lib-c8fdff20285b59cd892297317572fbb4c3633f78.tar.bz2
get rid of XINE_{ASSERT,ABORT} and useless xine_print_trace (useless). Replace XINE_ASSERT by _x_assert, which works exaclty as assert, except that it still warns with NDEBUG defined (but don't abort). Fix missuning of assert(0), which isn't safe, abort is abort, assert is for debugging purpose only, so all assert(0) has been converted to abort() alls. In osd_preload_fonts(): alloc needed memory chunk. Define NDEBUG in CFLAGS, for non DEBUG build only.
CVS patchset: 5860 CVS date: 2003/12/07 15:34:29
Diffstat (limited to 'src/xine-engine/osd.c')
-rw-r--r--src/xine-engine/osd.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c
index d4fd58d94..fee032df3 100644
--- a/src/xine-engine/osd.c
+++ b/src/xine-engine/osd.c
@@ -1149,29 +1149,30 @@ static int osd_get_text_size(osd_object_t *osd, const char *text, int *width, in
}
static void osd_preload_fonts (osd_renderer_t *this, char *path) {
- DIR *dir;
- osd_font_t *font;
- char *pathname;
- char *s, *p;
+ DIR *dir;
+ char *s, *p;
lprintf ("path='%s'\n", path);
- dir = opendir (path) ;
+ dir = opendir (path);
if (dir) {
-
- struct dirent *entry;
+ struct dirent *entry;
while ((entry = readdir (dir)) != NULL) {
- int len;
+ int len;
len = strlen (entry->d_name);
-
- if ( (len>12) && !strncmp (&entry->d_name[len-12], ".xinefont.gz", 12)) {
+
+ if ( (len > 12) && !strncmp (&entry->d_name[len-12], ".xinefont.gz", 12)) {
s = strdup(entry->d_name);
p = strchr(s, '-');
+
if( p ) {
+ osd_font_t *font;
+ char *pathname;
+
*p++ = '\0';
font = xine_xmalloc( sizeof(osd_font_t) );
@@ -1181,7 +1182,7 @@ static void osd_preload_fonts (osd_renderer_t *this, char *path) {
lprintf("font '%s' size %d is preloaded\n",
font->name, font->size);
- pathname = malloc(1024);
+ pathname = (char *) xine_xmalloc(strlen(path) + strlen(entry->d_name) + 2);
sprintf (pathname, "%s/%s", path, entry->d_name);
font->filename = pathname;