[vlc-devel] commit: lua_libs: release the playlist object. ( Rémi Duraffort )

git version control git at videolan.org
Mon Nov 16 22:12:55 CET 2009


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Mon Nov 16 22:12:52 2009 +0100| [49d423b347d68396a5abe0faa86993c6069f5c76] | committer: Rémi Duraffort 

lua_libs: release the playlist object.

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

 modules/misc/lua/libs/volume.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/modules/misc/lua/libs/volume.c b/modules/misc/lua/libs/volume.c
index 209da73..23a0d5c 100644
--- a/modules/misc/lua/libs/volume.c
+++ b/modules/misc/lua/libs/volume.c
@@ -55,7 +55,9 @@ static int vlclua_volume_set( lua_State *L )
     playlist_t *p_this = vlclua_get_playlist_internal( L );
     int i_volume = luaL_checkint( L, 1 );
     /* Do we need to check that i_volume is in the AOUT_VOLUME_MIN->MAX range?*/
-    return vlclua_push_ret( L, aout_VolumeSet( p_this, i_volume ) );
+    int i_ret = aout_VolumeSet( p_this, i_volume );
+    vlclua_release_playlist_internal( p_this );
+    return vlclua_push_ret( L, i_ret );
 }
 
 static int vlclua_volume_get( lua_State *L )
@@ -66,26 +68,27 @@ static int vlclua_volume_get( lua_State *L )
         lua_pushnumber( L, i_volume );
     else
         lua_pushnil( L );
+    vlclua_release_playlist_internal( p_this );
     return 1;
 }
 
 static int vlclua_volume_up( lua_State *L )
 {
     audio_volume_t i_volume;
-    aout_VolumeUp( vlclua_get_playlist_internal( L ),
-                   luaL_optint( L, 1, 1 ),
-                   &i_volume );
+    playlist_t *p_this = vlclua_get_playlist_internal( L );
+    aout_VolumeUp( p_this, luaL_optint( L, 1, 1 ), &i_volume );
     lua_pushnumber( L, i_volume );
+    vlclua_release_playlist_internal( p_this );
     return 1;
 }
 
 static int vlclua_volume_down( lua_State *L )
 {
     audio_volume_t i_volume;
-    aout_VolumeDown( vlclua_get_playlist_internal( L ),
-                     luaL_optint( L, 1, 1 ),
-                     &i_volume );
+    playlist_t *p_this = vlclua_get_playlist_internal( L );
+    aout_VolumeDown( p_this, luaL_optint( L, 1, 1 ), &i_volume );
     lua_pushnumber( L, i_volume );
+    vlclua_release_playlist_internal( p_this );
     return 1;
 }
 




More information about the vlc-devel mailing list