[vlc-commits] httplive module takes all cpu power when playing live	stream
    Luc Saillard 
    git at videolan.org
       
    Fri Jul 22 02:25:00 CEST 2011
    
    
  
vlc | branch: master | Luc Saillard <luc.saillard at sfr.com> | Wed Jul 20 17:42:13 2011 +0200| [fba893a1a379627546a2adccc75d77e409c694dc] | committer: Jean-Baptiste Kempf
httplive module takes all cpu power when playing live stream
When playing a live stream, the thread didn't wait for an event, so it's
like a while(1)... Just wait until we read/need a new segment.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fba893a1a379627546a2adccc75d77e409c694dc
---
 modules/stream_filter/httplive.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index 7994430..cc3fe48 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -1206,10 +1206,11 @@ static void* hls_Thread(void *p_this)
                     (p_sys->download.segment >= count)) &&
                    (p_sys->download.seek == -1))
             {
+                vlc_cond_wait(&p_sys->download.wait, &p_sys->download.lock_wait);
                 if (p_sys->b_live /*&& (mdate() >= p_sys->playlist.wakeup)*/)
                     break;
-                vlc_cond_wait(&p_sys->download.wait, &p_sys->download.lock_wait);
-                if (!vlc_object_alive(s)) break;
+                if (!vlc_object_alive(s))
+                    break;
             }
             /* */
             if (p_sys->download.seek >= 0)
    
    
More information about the vlc-commits
mailing list