[vlc-devel] [PATCH] LUA: Add protocol to vlc.path

Gaurav Narula gnarula94 at gmail.com
Wed Jan 4 22:14:40 CET 2012


---
 modules/lua/demux.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/modules/lua/demux.c b/modules/lua/demux.c
index 169d668..029c958 100644
--- a/modules/lua/demux.c
+++ b/modules/lua/demux.c
@@ -153,7 +153,13 @@ static int probe_luascript( vlc_object_t *p_this, const char * psz_filename,
     luaopen_stream( L );
     luaopen_variables( L );
     luaopen_xml( L );
-    lua_pushstring( L, p_demux->psz_location );
+
+    char *protocol = malloc(strlen(p_demux->psz_location) + strlen(p_demux->psz_access) + 5);
+    strcpy(protocol, p_demux->psz_access);
+    strcat(protocol, "://");
+    strcat(protocol, p_demux->psz_location);
+ 
+    lua_pushstring( L, protocol );
     lua_setfield( L, -2, "path" );
     lua_pushstring( L, p_demux->psz_access );
     lua_setfield( L, -2, "access" );
-- 
1.7.1




More information about the vlc-devel mailing list