[vlc-commits] Change goto to gotoitem for lua 5.2 compatibility. Maintain lua 5. 1 backwards compatibility.
Kelly Anderson
git at videolan.org
Sat Feb 4 18:36:02 CET 2012
vlc | branch: master | Kelly Anderson <kelly at silka.with-linux.com> | Fri Jan 6 08:36:56 2012 -0700| [9934897a3bfcfb8518ac35d9f1e24c6ce18761af] | committer: Antoine Cellerier
Change goto to gotoitem for lua 5.2 compatibility. Maintain lua 5.1 backwards compatibility.
OK, this patch should take into account the recommendations.
Signed-off-by: Antoine Cellerier <dionoea at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9934897a3bfcfb8518ac35d9f1e24c6ce18761af
---
modules/lua/libs/playlist.c | 5 +++--
share/lua/intf/cli.lua | 2 +-
share/lua/intf/modules/httprequests.lua | 4 ++--
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/modules/lua/libs/playlist.c b/modules/lua/libs/playlist.c
index 2336a37..7b1f697 100644
--- a/modules/lua/libs/playlist.c
+++ b/modules/lua/libs/playlist.c
@@ -123,7 +123,7 @@ static int vlclua_playlist_random( lua_State * L )
return i_ret;
}
-static int vlclua_playlist_goto( lua_State * L )
+static int vlclua_playlist_gotoitem( lua_State * L )
{
int i_id = luaL_checkint( L, 1 );
playlist_t *p_playlist = vlclua_get_playlist_internal( L );
@@ -377,7 +377,8 @@ static const luaL_Reg vlclua_playlist_reg[] = {
{ "repeat_", vlclua_playlist_repeat }, // ... provide repeat_ too.
{ "loop", vlclua_playlist_loop },
{ "random", vlclua_playlist_random },
- { "goto", vlclua_playlist_goto },
+ { "goto", vlclua_playlist_gotoitem },
+ { "gotoitem", vlclua_playlist_gotoitem },
{ "add", vlclua_playlist_add },
{ "enqueue", vlclua_playlist_enqueue },
{ "get", vlclua_playlist_get },
diff --git a/share/lua/intf/cli.lua b/share/lua/intf/cli.lua
index ed2a685..9de1d74 100644
--- a/share/lua/intf/cli.lua
+++ b/share/lua/intf/cli.lua
@@ -535,7 +535,7 @@ commands_ordered = {
{ "stop"; { func = skip2(vlc.playlist.stop); help = "stop stream" } };
{ "next"; { func = skip2(vlc.playlist.next); help = "next playlist item" } };
{ "prev"; { func = skip2(vlc.playlist.prev); help = "previous playlist item" } };
- { "goto"; { func = skip2(vlc.playlist.goto); help = "goto item at index" } };
+ { "goto"; { func = skip2(vlc.playlist.gotoitem); help = "goto item at index" ; aliases = { "gotoitem" } } };
{ "repeat"; { func = skip2(vlc.playlist.repeat_); args = "[on|off]"; help = "toggle playlist repeat" } };
{ "loop"; { func = skip2(vlc.playlist.loop); args = "[on|off]"; help = "toggle playlist loop" } };
{ "random"; { func = skip2(vlc.playlist.random); args = "[on|off]"; help = "toggle playlist random" } };
diff --git a/share/lua/intf/modules/httprequests.lua b/share/lua/intf/modules/httprequests.lua
index 407ab3e..56805ab 100644
--- a/share/lua/intf/modules/httprequests.lua
+++ b/share/lua/intf/modules/httprequests.lua
@@ -93,14 +93,14 @@ processcommands = function ()
if id == -1 then
vlc.playlist.play()
else
- vlc.playlist.goto(id)
+ vlc.playlist.gotoitem(id)
end
elseif command == "pl_pause" then
if vlc.playlist.status() == "stopped" then
if id == -1 then
vlc.playlist.play()
else
- vlc.playlist.goto(id)
+ vlc.playlist.gotoitem(id)
end
else
vlc.playlist.pause()
More information about the vlc-commits
mailing list