[vlc-commits] resource: check if sout is NULL just once

Rémi Denis-Courmont git at videolan.org
Thu Jan 21 19:56:00 UTC 2021


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Jan 19 19:36:20 2021 +0200| [87c360248f0764f78093e3fbf29e408fd1eb3264] | committer: Rémi Denis-Courmont

resource: check if sout is NULL just once

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

 src/input/resource.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/input/resource.c b/src/input/resource.c
index 530da5d6eb..ff05b5a32b 100644
--- a/src/input/resource.c
+++ b/src/input/resource.c
@@ -133,7 +133,10 @@ static void DestroySout( input_resource_t *p_resource )
 {
 #ifdef ENABLE_SOUT
     if( p_resource->p_sout )
+    {
+        msg_Dbg( p_resource->p_parent, "destroying stream output" );
         sout_DeleteInstance( p_resource->p_sout );
+    }
 #endif
     p_resource->p_sout = NULL;
 }
@@ -144,11 +147,7 @@ static sout_instance_t *RequestSout( input_resource_t *p_resource,
 #ifdef ENABLE_SOUT
     if( !p_sout && !psz_sout )
     {
-        if( p_resource->p_sout )
-        {
-            msg_Dbg( p_resource->p_parent, "destroying useless sout" );
-            DestroySout( p_resource );
-        }
+        DestroySout( p_resource );
         return NULL;
     }
 



More information about the vlc-commits mailing list