Commit 49d423b3 authored by Rémi Duraffort's avatar Rémi Duraffort

lua_libs: release the playlist object.

parent 66e29381
...@@ -55,7 +55,9 @@ static int vlclua_volume_set( lua_State *L ) ...@@ -55,7 +55,9 @@ static int vlclua_volume_set( lua_State *L )
playlist_t *p_this = vlclua_get_playlist_internal( L ); playlist_t *p_this = vlclua_get_playlist_internal( L );
int i_volume = luaL_checkint( L, 1 ); int i_volume = luaL_checkint( L, 1 );
/* Do we need to check that i_volume is in the AOUT_VOLUME_MIN->MAX range?*/ /* 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 ) static int vlclua_volume_get( lua_State *L )
...@@ -66,26 +68,27 @@ 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 ); lua_pushnumber( L, i_volume );
else else
lua_pushnil( L ); lua_pushnil( L );
vlclua_release_playlist_internal( p_this );
return 1; return 1;
} }
static int vlclua_volume_up( lua_State *L ) static int vlclua_volume_up( lua_State *L )
{ {
audio_volume_t i_volume; audio_volume_t i_volume;
aout_VolumeUp( vlclua_get_playlist_internal( L ), playlist_t *p_this = vlclua_get_playlist_internal( L );
luaL_optint( L, 1, 1 ), aout_VolumeUp( p_this, luaL_optint( L, 1, 1 ), &i_volume );
&i_volume );
lua_pushnumber( L, i_volume ); lua_pushnumber( L, i_volume );
vlclua_release_playlist_internal( p_this );
return 1; return 1;
} }
static int vlclua_volume_down( lua_State *L ) static int vlclua_volume_down( lua_State *L )
{ {
audio_volume_t i_volume; audio_volume_t i_volume;
aout_VolumeDown( vlclua_get_playlist_internal( L ), playlist_t *p_this = vlclua_get_playlist_internal( L );
luaL_optint( L, 1, 1 ), aout_VolumeDown( p_this, luaL_optint( L, 1, 1 ), &i_volume );
&i_volume );
lua_pushnumber( L, i_volume ); lua_pushnumber( L, i_volume );
vlclua_release_playlist_internal( p_this );
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment