[vlc-commits] background_worker: use a define for the inactive worker deadline

Steve Lhomme git at videolan.org
Fri May 4 10:37:57 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu May  3 17:00:34 2018 +0200| [7b98a5d8468955d0a4526a259ed1580453bfda07] | committer: Rémi Denis-Courmont

background_worker: use a define for the inactive worker deadline

Modified-and-...
Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

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

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

diff --git a/src/misc/background_worker.c b/src/misc/background_worker.c
index 58668a5bff..af50caed46 100644
--- a/src/misc/background_worker.c
+++ b/src/misc/background_worker.c
@@ -74,7 +74,7 @@ static void* Thread( void* data )
                 vlc_array_remove( &worker->tail.data, 0 );
             }
 
-            if( worker->head.deadline == VLC_TS_0 && item == NULL )
+            if( worker->head.deadline == VLC_TS_INVALID && item == NULL )
                 worker->head.active = false;
             worker->head.id = item ? item->id : NULL;
             vlc_cond_broadcast( &worker->head.wait );
@@ -86,7 +86,7 @@ static void* Thread( void* data )
                 else
                     worker->head.deadline = INT64_MAX;
             }
-            else if( worker->head.deadline != VLC_TS_0 )
+            else if( worker->head.deadline != VLC_TS_INVALID )
             {
                 /* Wait 1 seconds for new inputs before terminating */
                 mtime_t deadline = mdate() + INT64_C(1000000);
@@ -96,7 +96,7 @@ static void* Thread( void* data )
                 {
                     /* Timeout: if there is still no items, the thread will be
                      * terminated at next loop iteration (active = false). */
-                    worker->head.deadline = VLC_TS_0;
+                    worker->head.deadline = VLC_TS_INVALID;
                 }
                 continue;
             }
@@ -173,7 +173,7 @@ static void BackgroundWorkerCancel( struct background_worker* worker, void* id)
     while( ( id == NULL && worker->head.active )
         || ( id != NULL && worker->head.id == id ) )
     {
-        worker->head.deadline = VLC_TS_0;
+        worker->head.deadline = VLC_TS_INVALID;
         vlc_cond_signal( &worker->head.worker_wait );
         vlc_cond_signal( &worker->tail.wait );
         vlc_cond_wait( &worker->head.wait, &worker->lock );



More information about the vlc-commits mailing list