[vlc-devel] [PATCH 1/3] decoder: rename wait_fifo to wait_fifo_consumed

Thomas Guillem thomas at gllm.fr
Tue Oct 10 11:37:34 CEST 2017


And remove the TODO comment. Having more condictions variables doesn't
necessarily make the code more complex.
---
 src/input/decoder.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 54eec0f342..39ccd1acf0 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -101,7 +101,7 @@ struct decoder_owner_sys_t
     vlc_mutex_t lock;
     vlc_cond_t  wait_request;
     vlc_cond_t  wait_acknowledge;
-    vlc_cond_t  wait_fifo; /* TODO: merge with wait_acknowledge */
+    vlc_cond_t  wait_fifo_consumed;
     vlc_cond_t  wait_timed;
 
     /* -- These variables need locking on write(only) -- */
@@ -1576,7 +1576,7 @@ static void *DecoderThread( void *p_data )
             continue;
         }
 
-        vlc_cond_signal( &p_owner->wait_fifo );
+        vlc_cond_signal( &p_owner->wait_fifo_consumed );
         vlc_testcancel(); /* forced expedited cancellation in case of stop */
 
         block_t *p_block = vlc_fifo_DequeueUnlocked( p_owner->p_fifo );
@@ -1695,7 +1695,7 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
     vlc_mutex_init( &p_owner->lock );
     vlc_cond_init( &p_owner->wait_request );
     vlc_cond_init( &p_owner->wait_acknowledge );
-    vlc_cond_init( &p_owner->wait_fifo );
+    vlc_cond_init( &p_owner->wait_fifo_consumed );
     vlc_cond_init( &p_owner->wait_timed );
 
     /* Set buffers allocation callbacks for the decoders */
@@ -1853,7 +1853,7 @@ static void DeleteDecoder( decoder_t * p_dec )
     }
 
     vlc_cond_destroy( &p_owner->wait_timed );
-    vlc_cond_destroy( &p_owner->wait_fifo );
+    vlc_cond_destroy( &p_owner->wait_fifo_consumed );
     vlc_cond_destroy( &p_owner->wait_acknowledge );
     vlc_cond_destroy( &p_owner->wait_request );
     vlc_mutex_destroy( &p_owner->lock );
@@ -2032,7 +2032,7 @@ void input_DecoderDecode( decoder_t *p_dec, block_t *p_block, bool b_do_pace )
          * Locking is not necessary as b_waiting is only read, not written by
          * the decoder thread. */
         while( vlc_fifo_GetCount( p_owner->p_fifo ) >= 10 )
-            vlc_fifo_WaitCond( p_owner->p_fifo, &p_owner->wait_fifo );
+            vlc_fifo_WaitCond( p_owner->p_fifo, &p_owner->wait_fifo_consumed );
     }
 
     vlc_fifo_QueueUnlocked( p_owner->p_fifo, p_block );
-- 
2.11.0



More information about the vlc-devel mailing list