[MPlayer-dev-eng] [PATCH] Re: OSD problem

Eric Lammerts eric at lammerts.org
Mon Jun 24 00:28:05 CEST 2002


[ from -users: ]
On Mon, Jun 24, 2002 at 12:04:41AM +0300, ismail donmez wrote:
> Lethal Weapon wrote:
> >On Sun, 2002-06-23 at 22:53, ismail donmez wrote:
> >
> >>I compiled mplayer from cvs but I dont seem to have OSD.
>
> >have you installed the fonts so that osd can use them?
>
> Right that was the problem thnx! I should RTFM more .

To avoid more questions like that, please consider this patch. It prints a
warning message every time mplayer can't display OSD because the font is
missing. Maybe people will get a clue if they see hundreds of these error
messages scrolling past (yes I know messages like "font: can't open file:"
are printed at the beginning, but these are likely to be overlooked).

Eric

Index: libvo/sub.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/sub.c,v
retrieving revision 1.52
diff -u -r1.52 sub.c
--- libvo/sub.c	25 May 2002 17:40:33 -0000	1.52
+++ libvo/sub.c	23 Jun 2002 22:30:33 -0000
@@ -93,10 +93,15 @@
 
     obj->flags|=OSDFLAG_CHANGED|OSDFLAG_VISIBLE;
     
-    if(vo_osd_progbar_type<0 || !vo_font){
+    if(vo_osd_progbar_type<0){
        obj->flags&=~OSDFLAG_VISIBLE;
        return;
     }
+    if(!vo_font){
+       obj->flags&=~OSDFLAG_VISIBLE;
+       mp_msg(MSGT_OSD,MSGL_WARN,"Can't show progbar: no font loaded!\n");
+       return;
+    }
     
     {	int h=0;
         int y=(dys-vo_font->height)/2;
@@ -221,8 +226,13 @@
    
    obj->flags|=OSDFLAG_CHANGED|OSDFLAG_VISIBLE;
    
-   if(!vo_sub || !vo_font){
+   if(!vo_sub){
+       obj->flags&=~OSDFLAG_VISIBLE;
+       return;
+   }
+   if(!vo_font){
        obj->flags&=~OSDFLAG_VISIBLE;
+       mp_msg(MSGT_OSD,MSGL_WARN,"Can't show subtitle: no font loaded!\n");
        return;
    }
    
@@ -409,11 +419,17 @@
 		obj->flags&=~OSDFLAG_VISIBLE;
 	    break;
 	case OSDTYPE_OSD:
-	    if(vo_font && vo_osd_text && vo_osd_text[0]){
-		vo_update_text_osd(obj,dxs,dys); // update bbox
-		obj->flags|=OSDFLAG_VISIBLE|OSDFLAG_CHANGED;
-	    } else
+	    if(vo_osd_text && vo_osd_text[0]) {
+		if(vo_font){
+		    vo_update_text_osd(obj,dxs,dys); // update bbox
+		    obj->flags|=OSDFLAG_VISIBLE|OSDFLAG_CHANGED;
+		} else {
+		    mp_msg(MSGT_OSD,MSGL_WARN,"Can't show OSD: no font loaded!\n");
+		    obj->flags&=~OSDFLAG_VISIBLE;
+		}
+	    } else {
 		obj->flags&=~OSDFLAG_VISIBLE;
+	    }
 	    break;
 	}
 	// check bbox:



More information about the MPlayer-dev-eng mailing list