[vlc-commits] cue.lua: fix file path concatenation
Pierre Ynard
git at videolan.org
Sun Jan 8 16:27:18 CET 2012
vlc/vlc-1.2 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sat Jan 7 13:41:19 2012 +0100| [9b612d125e93a4af24c62deeed4739d5603072cd] | committer: Pierre Ynard
cue.lua: fix file path concatenation
Use the same approach as in the playlist module
This should fix #5398
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit b33269e785fbe4541c2b52700181c005066528d9)
Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=9b612d125e93a4af24c62deeed4739d5603072cd
---
share/lua/playlist/cue.lua | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/share/lua/playlist/cue.lua b/share/lua/playlist/cue.lua
index 57215e0..df0aefc 100644
--- a/share/lua/playlist/cue.lua
+++ b/share/lua/playlist/cue.lua
@@ -46,15 +46,14 @@ function cue_path( src )
if( string.match( src, "^/" ) or
string.match( src, "^\\" ) or
string.match( src, "^[%l%u]:\\" ) ) then
- return src
+ return vlc.strings.make_uri(src)
end
- local path = string.gsub( vlc.strings.decode_uri(vlc.path), '\\', '/' )
- local slash = string.find( string.reverse( path ), '/' )
- if( path == nil ) then
- return src
- end
- return string.sub( path, 1, -slash-1 ) .. '/' .. src
+ local slash = string.find( string.reverse( vlc.path ), '/' )
+ local prefix = vlc.access .. "://" .. string.sub( vlc.path, 1, -slash )
+ -- FIXME: postfix may not be encoded correctly (esp. slashes)
+ local postfix = vlc.strings.encode_uri_component(src)
+ return prefix .. postfix
end
function cue_track( global, track )
@@ -63,7 +62,7 @@ function cue_track( global, track )
end
t = {}
- t.path = vlc.strings.make_uri(cue_path( track.file or global.file ))
+ t.path = cue_path( track.file or global.file )
t.title = track.title
t.album = global.title
t.artist = track.performer or global.performer
More information about the vlc-commits
mailing list