[vlc-commits] Lua: input_AddSubtitle expects a file path, not an URL (fixes #11449)

Rémi Denis-Courmont git at videolan.org
Tue May 6 21:26:58 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue May  6 22:25:33 2014 +0300| [a5a33334e810a73fd5f136d58dc2cd3f95bc6493] | committer: Rémi Denis-Courmont

Lua: input_AddSubtitle expects a file path, not an URL (fixes #11449)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a5a33334e810a73fd5f136d58dc2cd3f95bc6493
---

 modules/lua/libs/input.c                |    6 +++---
 share/lua/README.txt                    |    2 +-
 share/lua/intf/modules/httprequests.lua |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/lua/libs/input.c b/modules/lua/libs/input.c
index bdffbc9..5b80080 100644
--- a/modules/lua/libs/input.c
+++ b/modules/lua/libs/input.c
@@ -218,9 +218,9 @@ static int vlclua_input_add_subtitle( lua_State *L )
     if( !p_input )
         return luaL_error( L, "can't add subtitle: no current input" );
     if( !lua_isstring( L, 1 ) )
-        return luaL_error( L, "vlc.input.add_subtitle() usage: (url)" );
-    const char *psz_url = luaL_checkstring( L, 1 );
-    input_AddSubtitle( p_input, psz_url, false );
+        return luaL_error( L, "vlc.input.add_subtitle() usage: (path)" );
+    const char *psz_path = luaL_checkstring( L, 1 );
+    input_AddSubtitle( p_input, psz_path, false );
     vlc_object_release( p_input );
     return 1;
 }
diff --git a/share/lua/README.txt b/share/lua/README.txt
index eb6a8b1..5d3343b 100644
--- a/share/lua/README.txt
+++ b/share/lua/README.txt
@@ -103,7 +103,7 @@ h:redirect( url_dst, url_src ): Redirect all connections from url_src to url_dst
 Input
 -----
 input.is_playing(): Return true if input exists.
-input.add_subtitle(url): Add a subtitle to the current input
+input.add_subtitle(url): Add a subtitle file (by path) to the current input
 input.item(): Get the current input item. Input item methods are:
   :uri(): Get item's URI.
   :name(): Get item's name.
diff --git a/share/lua/intf/modules/httprequests.lua b/share/lua/intf/modules/httprequests.lua
index f16e205..5e7351d 100644
--- a/share/lua/intf/modules/httprequests.lua
+++ b/share/lua/intf/modules/httprequests.lua
@@ -91,7 +91,7 @@ processcommands = function ()
         --]]
         vlc.playlist.add({{path=vlc.strings.make_uri(input),options=options,name=name,duration=duration}})
     elseif command == "addsubtitle" then
-        vlc.input.add_subtitle (vlc.strings.make_uri(val))
+        vlc.input.add_subtitle (val)
     elseif command == "in_enqueue" then
         vlc.playlist.enqueue({{path=vlc.strings.make_uri(input),options=options,name=name,duration=duration}})
     elseif command == "pl_play" then



More information about the vlc-commits mailing list