[MPlayer-dev-eng] [PATCH] VOBSUB/RAR absolute path problem

Reder Uwe Uwe.Reder at 3SOFT.de
Wed Nov 13 12:07:01 CET 2002


Hi,

When you called mplayer with the absolute path to the video and the VOBSUB subtitle is in a rar archive, mplayer tried to find the files in the archive with the absolute path. The patch fixes the problem by getting rid of the full path just trying the filename.

Bye,
Uwe.

--- snip snip ---

--- vobsub.c	2002/11/12 18:40:48	1.1
+++ vobsub.c	2002/11/12 19:14:15
@@ -82,7 +82,13 @@
 	    strcpy(rar_filename, filename);
 	    strcat(rar_filename, ".rar");
 	}
-	rc = urarlib_get(&stream->data, &stream->size, (char*) filename, rar_filename, "");
+	/* get rid of the path if there is any */
+	if ((p = strrchr(filename, '/')) == NULL) {
+		p = filename;
+	} else {
+		p++;
+	}
+	rc = urarlib_get(&stream->data, &stream->size, (char*) p, rar_filename, "");
 	free(rar_filename);
 	if (!rc) {
 	    free(stream);

--- snip snip ---



More information about the MPlayer-dev-eng mailing list