[vlc-commits] Change goto to gotoitem for lua 5.2 compatibility. Maintain lua 5. 1 backwards compatibility.

Kelly Anderson git at videolan.org
Sun Feb 5 15:08:04 CET 2012


vlc/vlc-2.0 | branch: master | Kelly Anderson <kelly at silka.with-linux.com> | Fri Jan  6 08:36:56 2012 -0700| [9037d5f93ae9907fb40cb79024cd8fb645a86546] | committer: Jean-Baptiste Kempf

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>
(cherry picked from commit 9934897a3bfcfb8518ac35d9f1e24c6ce18761af)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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 ae610f3..39f619e 100644
--- a/modules/lua/libs/playlist.c
+++ b/modules/lua/libs/playlist.c
@@ -126,7 +126,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 );
@@ -380,7 +380,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