view get_path.c @ 9046:13b7ad16f278

This patch should fix the display problem with 4bpp and 8bpp modes. The problem was that the new drawing method assumes a linear framebuffer, which is not available in those modes. This can be worked around by using the old drawing method, which is what this patch does. The old method can be forced, by using the "old" driver option. This patch also enables linear addressing, since it improves write speed to video memory considerably. The mentioned problem: "it is not compatable with vga_draw* for some cards" Is a bug in svgalib, which I think should be fixed in recent svgalib versions. If someone sees this problem, please report to svgalib maintainer (that's me). patch by Matan Ziv-Av. matan@svgalib.org
author arpi
date Mon, 20 Jan 2003 21:33:11 +0000
parents d21bae2028a6
children ad429d617df4
line wrap: on
line source


char *get_path(char *filename){
	char *homedir;
	char *buff;
	static char *config_dir = "/.mplayer";
	int len;

	if ((homedir = getenv("HOME")) == NULL)
		return NULL;
	len = strlen(homedir) + strlen(config_dir) + 1;
	if (filename == NULL) {
		if ((buff = (char *) malloc(len)) == NULL)
			return NULL;
		sprintf(buff, "%s%s", homedir, config_dir);
	} else {
		len += strlen(filename) + 1;
		if ((buff = (char *) malloc(len)) == NULL)
			return NULL;
		sprintf(buff, "%s%s/%s", homedir, config_dir, filename);
	}
	mp_msg(MSGT_GLOBAL,MSGL_V,"get_path('%s') -> '%s'\n",filename,buff);
	return buff;
}