[vlc-devel] [PATCH 2/4] vlm: simplify

RĂ©mi Denis-Courmont remi at remlab.net
Thu Aug 27 18:43:22 CEST 2020


---
 src/input/vlmshell.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/input/vlmshell.c b/src/input/vlmshell.c
index 661a64c782..733d7719a0 100644
--- a/src/input/vlmshell.c
+++ b/src/input/vlmshell.c
@@ -253,12 +253,7 @@ static int ExecuteShow( vlm_t *p_vlm, const char *psz_name, vlm_message_t **pp_s
     }
 
     p_media = vlm_MediaSearch( p_vlm, psz_name );
-
-    if( p_media != NULL )
-        *pp_status = vlm_Show( p_vlm, p_media, NULL );
-    else
-        *pp_status = vlm_Show( p_vlm, NULL, psz_name );
-
+    *pp_status = vlm_Show( p_vlm, p_media, psz_name );
     return VLC_SUCCESS;
 }
 
@@ -974,7 +969,7 @@ static vlm_message_t *vlm_Show( vlm_t *vlm, vlm_media_sys_t *media,
         return p_msg;
     }
 
-    else if( psz_filter && !strcmp( psz_filter, "media" ) )
+    else if( psz_filter == NULL || !strcmp( psz_filter, "media" ) )
     {
         vlm_message_t *p_msg;
         vlm_message_t *p_msg_child;
@@ -990,11 +985,6 @@ static vlm_message_t *vlm_Show( vlm_t *vlm, vlm_media_sys_t *media,
         return p_msg;
     }
 
-    else if( ( psz_filter == NULL ) && ( media == NULL ) )
-    {
-        return vlm_Show( vlm, NULL, "media" );
-    }
-
     else
     {
         return vlm_MessageSimpleNew( "show" );
-- 
2.28.0



More information about the vlc-devel mailing list