changeset 10618:7901f7d6e0eb

4x10l fix. Vars used by the config layer must be malloc'd (strdup) as they will be freed at exit.
author alex
date Fri, 15 Aug 2003 13:04:37 +0000
parents 4b9c5abf2f60
children e28ed5ea9790
files libvo/vo_directfb.c libvo/vo_directfb2.c libvo/vo_fbdev.c
diffstat 3 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_directfb.c	Fri Aug 15 12:55:29 2003 +0000
+++ b/libvo/vo_directfb.c	Fri Aug 15 13:04:37 2003 +0000
@@ -314,7 +314,7 @@
 	    (directfb_minor_version <= 9) &&
 	    (directfb_micro_version < 7)))
 	{
-    	    if (!fb_dev_name && !(fb_dev_name = getenv("FRAMEBUFFER"))) fb_dev_name = "/dev/fb0";
+    	    if (!fb_dev_name && !(fb_dev_name = getenv("FRAMEBUFFER"))) fb_dev_name = strdup("/dev/fb0");
     	    DFBCHECK (DirectFBSetOption ("fbdev",fb_dev_name));
 	}
 
--- a/libvo/vo_directfb2.c	Fri Aug 15 12:55:29 2003 +0000
+++ b/libvo/vo_directfb2.c	Fri Aug 15 13:04:37 2003 +0000
@@ -297,7 +297,7 @@
    * (set options)
    */
 	
-	if (!fb_dev_name && !(fb_dev_name = getenv("FRAMEBUFFER"))) fb_dev_name = "/dev/fb0";
+	if (!fb_dev_name && !(fb_dev_name = getenv("FRAMEBUFFER"))) fb_dev_name = strdup("/dev/fb0");
     	DFBCHECK (DirectFBSetOption ("fbdev",fb_dev_name));
 	
 //	uncomment this if you do not wish to create a new vt for DirectFB
--- a/libvo/vo_fbdev.c	Fri Aug 15 12:55:29 2003 +0000
+++ b/libvo/vo_fbdev.c	Fri Aug 15 13:04:37 2003 +0000
@@ -529,7 +529,7 @@
 
 /* command line/config file options */
 char *fb_dev_name = NULL;
-char *fb_mode_cfgfile = "/etc/fb.modes";
+char *fb_mode_cfgfile = NULL;
 char *fb_mode_name = NULL;
 
 static fb_mode_t *fb_mode = NULL;
@@ -663,7 +663,7 @@
 		return fb_works;
 
 	if (!fb_dev_name && !(fb_dev_name = getenv("FRAMEBUFFER")))
-		fb_dev_name = "/dev/fb0";
+		fb_dev_name = strdup("/dev/fb0");
 	mp_msg(MSGT_VO, MSGL_V, "using %s\n", fb_dev_name);
 
 	if ((fb_dev_fd = open(fb_dev_name, O_RDWR)) == -1) {
@@ -696,6 +696,9 @@
 		}
 		fb_bpp = vo_dbpp;		
 	}
+	
+	if (!fb_mode_cfgfile)
+	    fb_mode_cfgfile = strdup("/etc/fb.modes");
 
 	fb_preinit_done = 1;
 	fb_works = 1;