[vlc-commits] resource: remove intermediate functions

Thomas Guillem git at videolan.org
Tue May 7 17:45:00 CEST 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Apr 16 13:50:48 2019 +0200| [2841f5a6538be06844fc4227d2b4fdda5863eed6] | committer: Thomas Guillem

resource: remove intermediate functions

No functional changes.

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

 src/input/resource.c | 81 +++++++++++++++++++++++-----------------------------
 1 file changed, 35 insertions(+), 46 deletions(-)

diff --git a/src/input/resource.c b/src/input/resource.c
index 0812db6fe6..13b4b97d07 100644
--- a/src/input/resource.c
+++ b/src/input/resource.c
@@ -194,50 +194,6 @@ static void DisplayVoutTitle( input_resource_t *p_resource,
     free( psz_nowplaying );
 }
 
-static vout_thread_t *HoldVout( input_resource_t *p_resource )
-{
-    /* TODO FIXME: p_resource->pp_vout order is NOT stable */
-    vlc_mutex_lock( &p_resource->lock_hold );
-
-    vout_thread_t *p_vout = p_resource->i_vout > 0 ? p_resource->pp_vout[0] : NULL;
-    if( p_vout )
-        vout_Hold(p_vout);
-
-    vlc_mutex_unlock( &p_resource->lock_hold );
-
-    return p_vout;
-}
-
-static void HoldVouts( input_resource_t *p_resource, vout_thread_t ***ppp_vout,
-                       size_t *pi_vout )
-{
-    vout_thread_t **pp_vout;
-
-    *pi_vout = 0;
-    *ppp_vout = NULL;
-
-    vlc_mutex_lock( &p_resource->lock_hold );
-
-    if( p_resource->i_vout <= 0 )
-        goto exit;
-
-    pp_vout = vlc_alloc( p_resource->i_vout, sizeof(*pp_vout) );
-    if( !pp_vout )
-        goto exit;
-
-    *ppp_vout = pp_vout;
-    *pi_vout = p_resource->i_vout;
-
-    for( int i = 0; i < p_resource->i_vout; i++ )
-    {
-        pp_vout[i] = p_resource->pp_vout[i];
-        vout_Hold(pp_vout[i]);
-    }
-
-exit:
-    vlc_mutex_unlock( &p_resource->lock_hold );
-}
-
 /* Audio output */
 audio_output_t *input_resource_GetAout( input_resource_t *p_resource )
 {
@@ -446,13 +402,46 @@ void input_resource_PutVout(input_resource_t *p_resource,
 
 vout_thread_t *input_resource_HoldVout( input_resource_t *p_resource )
 {
-    return HoldVout( p_resource );
+    /* TODO FIXME: p_resource->pp_vout order is NOT stable */
+    vlc_mutex_lock( &p_resource->lock_hold );
+
+    vout_thread_t *p_vout = p_resource->i_vout > 0 ? p_resource->pp_vout[0] : NULL;
+    if( p_vout )
+        vout_Hold(p_vout);
+
+    vlc_mutex_unlock( &p_resource->lock_hold );
+
+    return p_vout;
 }
 
 void input_resource_HoldVouts( input_resource_t *p_resource, vout_thread_t ***ppp_vout,
                                size_t *pi_vout )
 {
-    HoldVouts( p_resource, ppp_vout, pi_vout );
+    vout_thread_t **pp_vout;
+
+    *pi_vout = 0;
+    *ppp_vout = NULL;
+
+    vlc_mutex_lock( &p_resource->lock_hold );
+
+    if( p_resource->i_vout <= 0 )
+        goto exit;
+
+    pp_vout = vlc_alloc( p_resource->i_vout, sizeof(*pp_vout) );
+    if( !pp_vout )
+        goto exit;
+
+    *ppp_vout = pp_vout;
+    *pi_vout = p_resource->i_vout;
+
+    for( int i = 0; i < p_resource->i_vout; i++ )
+    {
+        pp_vout[i] = p_resource->pp_vout[i];
+        vout_Hold(pp_vout[i]);
+    }
+
+exit:
+    vlc_mutex_unlock( &p_resource->lock_hold );
 }
 
 void input_resource_TerminateVout( input_resource_t *p_resource )



More information about the vlc-commits mailing list