[vlc-commits] Lua: refactor
Rémi Denis-Courmont
git at videolan.org
Mon Jul 6 19:04:59 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Jul 6 20:01:41 2015 +0300| [bae1e6a0970e4bd203130ba23e9a58038373ebdd] | committer: Rémi Denis-Courmont
Lua: refactor
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bae1e6a0970e4bd203130ba23e9a58038373ebdd
---
modules/lua/libs/net.c | 9 +++++++--
modules/lua/vlc.h | 1 +
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/modules/lua/libs/net.c b/modules/lua/libs/net.c
index f46c66c..0df586a 100644
--- a/modules/lua/libs/net.c
+++ b/modules/lua/libs/net.c
@@ -53,6 +53,12 @@ static vlclua_dtable_t *vlclua_get_dtable( lua_State *L )
return vlclua_get_object( L, vlclua_get_dtable );
}
+vlc_interrupt_t *vlclua_set_interrupt( lua_State *L )
+{
+ vlclua_dtable_t *dt = vlclua_get_dtable( L );
+ return vlc_interrupt_set( dt->interrupt );
+}
+
/** Maps an OS file descriptor to a VLC Lua file descriptor */
static int vlclua_fd_map( lua_State *L, int fd )
{
@@ -343,8 +349,7 @@ static int vlclua_net_poll( lua_State *L )
lua_pop( L, 1 );
}
- vlclua_dtable_t *dt = vlclua_get_dtable( L );
- vlc_interrupt_t *oint = vlc_interrupt_set( dt->interrupt );
+ vlc_interrupt_t *oint = vlclua_set_interrupt( L );
int ret = 1, val;
do
diff --git a/modules/lua/vlc.h b/modules/lua/vlc.h
index c7272f3..53d9761 100644
--- a/modules/lua/vlc.h
+++ b/modules/lua/vlc.h
@@ -180,6 +180,7 @@ typedef struct
int vlclua_fd_init( lua_State *, vlclua_dtable_t * );
void vlclua_fd_interrupt( vlclua_dtable_t * );
void vlclua_fd_cleanup( vlclua_dtable_t * );
+struct vlc_interrupt *vlclua_set_interrupt( lua_State *L );
/**
* Per-interface private state
More information about the vlc-commits
mailing list