From e97c8b3668d04396e892ad80e9d5a33d1a72e24b Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Escudier?= Date: Fri, 12 Jun 2009 16:54:48 +0200 Subject: [PATCH] libvlc vlm init fix Don't test p_vlm twice if it wasn't NULL the first time Don't add the callback if the creation failed MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémi Denis-Courmont --- src/control/vlm.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/control/vlm.c b/src/control/vlm.c index 824d57d7f1..bbeb883aaf 100644 --- a/src/control/vlm.c +++ b/src/control/vlm.c @@ -159,15 +159,16 @@ static int libvlc_vlm_init( libvlc_instance_t *p_instance, if( !p_instance->p_vlm ) { p_instance->p_vlm = vlm_New( p_instance->p_libvlc_int ); + if( !p_instance->p_vlm ) + { + libvlc_exception_raise( p_exception, + "Unable to create VLM." ); + return VLC_EGENERIC; + } var_AddCallback( (vlc_object_t *)p_instance->p_vlm, "intf-event", VlmEvent, p_instance->p_event_manager ); } - if( !p_instance->p_vlm ) - { - libvlc_exception_raise( p_exception, - "Unable to create VLM." ); - return VLC_EGENERIC; - } + return VLC_SUCCESS; } #define VLM_RET(p,ret) do { \ -- 2.39.2