[vlc-devel] [PATCH 1/9] resource: check if sout is NULL just once
remi at remlab.net
remi at remlab.net
Tue Jan 19 18:21:06 UTC 2021
From: RĂ©mi Denis-Courmont <remi at remlab.net>
---
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;
}
--
2.30.0
More information about the vlc-devel
mailing list