[vlc-commits] access: udp: only dequeue one after sem_wait

Ilkka Ollakka git at videolan.org
Sat Sep 24 18:15:33 CEST 2016


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sat Sep 24 16:47:33 2016 +0300| [badd3e9168afed002df996319dc198f3756876ba] | committer: Ilkka Ollakka

access: udp: only dequeue one after sem_wait

This helps to keep semaphore value in a meaningful state.
Also there is no need to post semaphore on timeout case.

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

 modules/access/udp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/access/udp.c b/modules/access/udp.c
index 61af085..eb2dbc4 100644
--- a/modules/access/udp.c
+++ b/modules/access/udp.c
@@ -274,7 +274,7 @@ static block_t *BlockUDP( access_t *p_access, bool *restrict eof )
     vlc_sem_wait_i11e(&sys->semaphore);
     vlc_fifo_Lock(sys->fifo);
 
-    block = vlc_fifo_DequeueAllUnlocked(sys->fifo);
+    block = vlc_fifo_DequeueUnlocked(sys->fifo);
     vlc_fifo_Unlock(sys->fifo);
 
     return block;
@@ -324,7 +324,6 @@ static void* ThreadRead( void *data )
             {
                 msg_Err( access, "Timeout on receiving, timeout %d seconds", sys->timeout/1000 );
                 atomic_store(&sys->timeout_reached, true);
-                vlc_sem_post(&sys->semaphore);
                 len=0;
                 break;
             }



More information about the vlc-commits mailing list