Mercurial > mplayer.hg
comparison sub/vobsub.c @ 32588:aa82dfc7bd49
Make use of mp_basename in a few places.
author | cboesch |
---|---|
date | Sat, 04 Dec 2010 10:24:42 +0000 |
parents | b39155e98ac3 |
children | 45e772bf4d6a |
comparison
equal
deleted
inserted
replaced
32587:c878178a05f2 | 32588:aa82dfc7bd49 |
---|---|
34 #include "config.h" | 34 #include "config.h" |
35 #include "mpcommon.h" | 35 #include "mpcommon.h" |
36 #include "vobsub.h" | 36 #include "vobsub.h" |
37 #include "spudec.h" | 37 #include "spudec.h" |
38 #include "mp_msg.h" | 38 #include "mp_msg.h" |
39 #include "path.h" | |
39 #include "unrar_exec.h" | 40 #include "unrar_exec.h" |
40 #include "libavutil/common.h" | 41 #include "libavutil/common.h" |
41 | 42 |
42 // Record the original -vobsubid set by commandline, since vobsub_id will be | 43 // Record the original -vobsubid set by commandline, since vobsub_id will be |
43 // overridden if slang match any of vobsub streams. | 44 // overridden if slang match any of vobsub streams. |
93 } | 94 } |
94 strcpy(rar_filename, filename); | 95 strcpy(rar_filename, filename); |
95 strcat(rar_filename, ".rar"); | 96 strcat(rar_filename, ".rar"); |
96 } | 97 } |
97 /* get rid of the path if there is any */ | 98 /* get rid of the path if there is any */ |
98 if ((p = strrchr(filename, '/')) == NULL) { | 99 p = mp_basename(filename); |
99 p = filename; | |
100 } else { | |
101 p++; | |
102 } | |
103 rc = unrar_exec_get(&stream->data, &stream->size, p, rar_filename); | 100 rc = unrar_exec_get(&stream->data, &stream->size, p, rar_filename); |
104 if (!rc) { | 101 if (!rc) { |
105 /* There is no matching filename in the archive. However, sometimes | 102 /* There is no matching filename in the archive. However, sometimes |
106 * the files we are looking for have been given arbitrary names in the archive. | 103 * the files we are looking for have been given arbitrary names in the archive. |
107 * Let's look for a file with an exact match in the extension only. */ | 104 * Let's look for a file with an exact match in the extension only. */ |