summaryrefslogtreecommitdiffstats
path: root/vobsub.c
diff options
context:
space:
mode:
Diffstat (limited to 'vobsub.c')
-rw-r--r--vobsub.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/vobsub.c b/vobsub.c
index e9868b3f2c..08efa3acec 100644
--- a/vobsub.c
+++ b/vobsub.c
@@ -36,6 +36,7 @@
#include "vobsub.h"
#include "spudec.h"
#include "mp_msg.h"
+#include "path.h"
#include "unrar_exec.h"
#include "libavutil/common.h"
@@ -96,11 +97,7 @@ static rar_stream_t *rar_open(const char *const filename,
strcat(rar_filename, ".rar");
}
/* get rid of the path if there is any */
- if ((p = strrchr(filename, '/')) == NULL) {
- p = filename;
- } else {
- p++;
- }
+ p = mp_basename(filename);
rc = unrar_exec_get(&stream->data, &stream->size, p, rar_filename);
if (!rc) {
/* There is no matching filename in the archive. However, sometimes