Commit a5a33334 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

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

parent 2ddd0f3e
...@@ -218,9 +218,9 @@ static int vlclua_input_add_subtitle( lua_State *L ) ...@@ -218,9 +218,9 @@ static int vlclua_input_add_subtitle( lua_State *L )
if( !p_input ) if( !p_input )
return luaL_error( L, "can't add subtitle: no current input" ); return luaL_error( L, "can't add subtitle: no current input" );
if( !lua_isstring( L, 1 ) ) if( !lua_isstring( L, 1 ) )
return luaL_error( L, "vlc.input.add_subtitle() usage: (url)" ); return luaL_error( L, "vlc.input.add_subtitle() usage: (path)" );
const char *psz_url = luaL_checkstring( L, 1 ); const char *psz_path = luaL_checkstring( L, 1 );
input_AddSubtitle( p_input, psz_url, false ); input_AddSubtitle( p_input, psz_path, false );
vlc_object_release( p_input ); vlc_object_release( p_input );
return 1; return 1;
} }
......
...@@ -103,7 +103,7 @@ h:redirect( url_dst, url_src ): Redirect all connections from url_src to url_dst ...@@ -103,7 +103,7 @@ h:redirect( url_dst, url_src ): Redirect all connections from url_src to url_dst
Input Input
----- -----
input.is_playing(): Return true if input exists. 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: input.item(): Get the current input item. Input item methods are:
:uri(): Get item's URI. :uri(): Get item's URI.
:name(): Get item's name. :name(): Get item's name.
......
...@@ -91,7 +91,7 @@ processcommands = function () ...@@ -91,7 +91,7 @@ processcommands = function ()
--]] --]]
vlc.playlist.add({{path=vlc.strings.make_uri(input),options=options,name=name,duration=duration}}) vlc.playlist.add({{path=vlc.strings.make_uri(input),options=options,name=name,duration=duration}})
elseif command == "addsubtitle" then elseif command == "addsubtitle" then
vlc.input.add_subtitle (vlc.strings.make_uri(val)) vlc.input.add_subtitle (val)
elseif command == "in_enqueue" then elseif command == "in_enqueue" then
vlc.playlist.enqueue({{path=vlc.strings.make_uri(input),options=options,name=name,duration=duration}}) vlc.playlist.enqueue({{path=vlc.strings.make_uri(input),options=options,name=name,duration=duration}})
elseif command == "pl_play" then elseif command == "pl_play" then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment