[vlc-commits] srt: remove tautology

Rémi Denis-Courmont git at videolan.org
Mon Jul 2 20:52:19 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul  1 21:38:22 2018 +0300| [d36c9ea4d1c0d696375c608d66f017741c40bfe8] | committer: Rémi Denis-Courmont

srt: remove tautology

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

 modules/access/srt.c | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/modules/access/srt.c b/modules/access/srt.c
index a7ac7e0585..9b28f5ddb6 100644
--- a/modules/access/srt.c
+++ b/modules/access/srt.c
@@ -345,13 +345,10 @@ static int Open(vlc_object_t *p_this)
 failed:
     vlc_mutex_destroy( &p_sys->lock );
 
-    if ( p_sys != NULL )
-    {
-        if ( p_sys->sock != -1 ) srt_close( p_sys->sock );
-        if ( p_sys->i_poll_id != -1 ) srt_epoll_release( p_sys->i_poll_id );
+    if ( p_sys->sock != -1 ) srt_close( p_sys->sock );
+    if ( p_sys->i_poll_id != -1 ) srt_epoll_release( p_sys->i_poll_id );
 
-        free( p_sys->psz_host );
-    }
+    free( p_sys->psz_host );
 
     return VLC_EGENERIC;
 }
@@ -361,17 +358,13 @@ static void Close(vlc_object_t *p_this)
     stream_t     *p_stream = (stream_t*)p_this;
     stream_sys_t *p_sys = p_stream->p_sys;
 
-    if ( p_sys )
-    {
-        vlc_mutex_destroy( &p_sys->lock );
-
-        srt_epoll_remove_usock( p_sys->i_poll_id, p_sys->sock );
-        srt_close( p_sys->sock );
-        srt_epoll_release( p_sys->i_poll_id );
+    vlc_mutex_destroy( &p_sys->lock );
 
-        free( p_sys->psz_host );
-    }
+    srt_epoll_remove_usock( p_sys->i_poll_id, p_sys->sock );
+    srt_close( p_sys->sock );
+    srt_epoll_release( p_sys->i_poll_id );
 
+    free( p_sys->psz_host );
     srt_cleanup();
 }
 



More information about the vlc-commits mailing list