[vlc-commits] commit: LUA: do not blindly cast object to interface thread (fix #3396) ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Sun Apr 11 13:57:25 CEST 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Apr 11 14:56:27 2010 +0300| [2b7581cdb833d7b9618ba0bd7e0fdcf298e8529f] | committer: Rémi Denis-Courmont 

LUA: do not blindly cast object to interface thread (fix #3396)

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

 modules/misc/lua/libs/misc.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/modules/misc/lua/libs/misc.c b/modules/misc/lua/libs/misc.c
index 54bac3d..b2fb76e 100644
--- a/modules/misc/lua/libs/misc.c
+++ b/modules/misc/lua/libs/misc.c
@@ -203,8 +203,7 @@ static int vlclua_datadir_list( lua_State *L )
  *****************************************************************************/
 static int vlclua_lock_and_wait( lua_State *L )
 {
-    intf_thread_t *p_intf = (intf_thread_t *)vlclua_get_this( L );
-    intf_sys_t *p_sys = p_intf->p_sys;
+    intf_sys_t *p_sys = vlclua_get_intf( L );
 
     vlc_mutex_lock( &p_sys->lock );
     mutex_cleanup_push( &p_sys->lock );
@@ -230,8 +229,8 @@ static int vlclua_mwait( lua_State *L )
 
 static int vlclua_intf_should_die( lua_State *L )
 {
-    intf_thread_t *p_intf = (intf_thread_t*)vlclua_get_this( L );
-    lua_pushboolean( L, p_intf->p_sys->exiting );
+    intf_sys_t *p_sys = vlclua_get_intf( L );
+    lua_pushboolean( L, p_sys->exiting );
     return 1;
 }
 



More information about the vlc-commits mailing list