[vlc-devel] [RFC PATCH 07/12] decoder: set drained status in draining scope

Thomas Guillem thomas at gllm.fr
Tue Jul 19 19:36:29 CEST 2016


---
 src/input/decoder.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index ada39ca..69e4fc5 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1567,13 +1567,13 @@ static void *DecoderThread( void *p_data )
              * queued to the output at this point. Now drain the output. */
             if( p_owner->p_aout != NULL )
                 aout_DecFlush( p_owner->p_aout, true );
+
+            /* Given that the drained flag is only polled, an atomic variable is
+             * sufficient. TODO? Wait for draining instead of polling. */
+            atomic_store( &p_owner->drained, true );
         }
         vlc_restorecancel( canc );
 
-        /* Given that the drained flag is only polled, an atomic variable is
-         * sufficient. TODO? Wait for draining instead of polling. */
-        atomic_store( &p_owner->drained, (p_block == NULL) );
-
         vlc_mutex_lock( &p_owner->lock );
         vlc_fifo_Lock( p_owner->p_fifo );
         vlc_cond_signal( &p_owner->wait_acknowledge );
-- 
2.8.1



More information about the vlc-devel mailing list