summaryrefslogtreecommitdiffstats
path: root/playtreeparser.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-02-06 20:57:25 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-02-06 20:57:25 +0000
commit30116881802c5e2a206647973e3d362b4032ec9d (patch)
treef5d7371d5d9ccc472d63ad78776749f7bdbbfbf0 /playtreeparser.c
parent705681b0dbd9ec3158849dcb5695f386fdeb119d (diff)
downloadmpv-30116881802c5e2a206647973e3d362b4032ec9d.tar.bz2
mpv-30116881802c5e2a206647973e3d362b4032ec9d.tar.xz
this patch fixes latest bug, discovered by .so ... (relative filenames &
playlists) This affects also the gui (filenames with space) patch by Fabian Franz <FabianFranz@gmx.de> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9302 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'playtreeparser.c')
-rw-r--r--playtreeparser.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/playtreeparser.c b/playtreeparser.c
index a0d74556a0..63da140782 100644
--- a/playtreeparser.c
+++ b/playtreeparser.c
@@ -493,6 +493,26 @@ play_tree_add_basepath(play_tree_t* pt, char* bp) {
}
}
+// Wrapper for play_tree_add_basepath (add base path from file)
+void play_tree_add_bpf(play_tree_t* pt, char* filename)
+{
+ char *ls, *file;
+
+ if (pt && filename)
+ {
+ file = strdup(filename);
+ if (file)
+ {
+ ls = strrchr(file,PATH_SEP);
+ if(ls) {
+ ls[1] = '\0';
+ play_tree_add_basepath(pt,file);
+ }
+ free(file);
+ }
+ }
+}
+
play_tree_t*
parse_playlist_file(char* file) {
stream_t *stream;
@@ -517,13 +537,7 @@ parse_playlist_file(char* file) {
mp_msg(MSGT_PLAYTREE,MSGL_ERR,"Warning error while closing playlist file %s : %s\n",file,strerror(errno));
free_stream(stream);
- if(ret) {
- char* ls = strrchr(file,PATH_SEP);
- if(ls) {
- ls[1] = '\0';
- play_tree_add_basepath(ret,file);
- }
- }
+ play_tree_add_bpf(ret, file);
return ret;