[vlc-devel] [PATCH] httplive module takes all cpu power when playing live stream

Luc Saillard luc.saillard at sfr.com
Wed Jul 20 17:42:13 CEST 2011


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.
---
 modules/stream_filter/httplive.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index 7994430..bf834e3 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))
             {
-                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 (p_sys->b_live)
+                    break;
+                if (!vlc_object_alive(s))
+                    break;
             }
             /* */
             if (p_sys->download.seek >= 0)
-- 
1.7.2.5


-- 
Luc Saillard  -+-  SFR/DGRE/DT/TPS/PFD



More information about the vlc-devel mailing list