[vlc-commits] lua/objects: playlist cannot be nul
Rémi Denis-Courmont
git at videolan.org
Wed Mar 6 21:57:43 CET 2019
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Mar 6 22:32:23 2019 +0200| [c06db92c18586478873ef7ac77664d492af0f21f] | committer: Rémi Denis-Courmont
lua/objects: playlist cannot be nul
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c06db92c18586478873ef7ac77664d492af0f21f
---
modules/lua/libs/objects.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/modules/lua/libs/objects.c b/modules/lua/libs/objects.c
index 73db98e8bd..232ac5878f 100644
--- a/modules/lua/libs/objects.c
+++ b/modules/lua/libs/objects.c
@@ -87,12 +87,8 @@ static int vlclua_get_libvlc( lua_State *L )
static int vlclua_get_playlist( lua_State *L )
{
playlist_t *p_playlist = vlclua_get_playlist_internal( L );
- if( p_playlist )
- {
- vlc_object_hold( p_playlist );
- vlclua_push_vlc_object(L, VLC_OBJECT(p_playlist));
- }
- else lua_pushnil( L );
+ vlc_object_hold( p_playlist );
+ vlclua_push_vlc_object(L, VLC_OBJECT(p_playlist));
return 1;
}
@@ -127,14 +123,11 @@ static int vlclua_get_vout( lua_State *L )
static int vlclua_get_aout( lua_State *L )
{
playlist_t *p_playlist = vlclua_get_playlist_internal( L );
- if( p_playlist != NULL )
+ audio_output_t *p_aout = playlist_GetAout( p_playlist );
+ if( p_aout != NULL )
{
- audio_output_t *p_aout = playlist_GetAout( p_playlist );
- if( p_aout != NULL )
- {
- vlclua_push_vlc_object( L, (vlc_object_t *)p_aout );
- return 1;
- }
+ vlclua_push_vlc_object( L, (vlc_object_t *)p_aout );
+ return 1;
}
lua_pushnil( L );
return 1;
More information about the vlc-commits
mailing list