[vlc-commits] stream_filter: httplive: pause before segment selection

Francois Cartegnie git at videolan.org
Tue Apr 21 21:07:12 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Apr 21 20:49:19 2015 +0200| [345370222094f149c76f724f7f67a95255faff28] | committer: Francois Cartegnie

stream_filter: httplive: pause before segment selection

segment depends on current time for live streams
and might have been removed

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

 modules/stream_filter/httplive.c |   14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index 53af8cb..e3e8f9b 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -1683,7 +1683,11 @@ static void* hls_Thread(void *p_this)
             vlc_mutex_unlock(&p_sys->download.lock_wait);
         }
 
-        vlc_testcancel();
+        vlc_mutex_lock(&p_sys->lock);
+        mutex_cleanup_push(&p_sys->lock); //C1
+        while (p_sys->paused)
+            vlc_cond_wait(&p_sys->wait, &p_sys->lock);
+        vlc_cleanup_run( ); //C1 vlc_mutex_unlock(&p_sys->lock);
 
         vlc_mutex_lock(&hls->lock);
         segment_t *segment = segment_GetSegment(hls, p_sys->download.segment);
@@ -1843,14 +1847,6 @@ static int hls_Download(stream_t *s, segment_t *segment)
     stream_sys_t *p_sys = s->p_sys;
     assert(segment);
 
-    vlc_mutex_lock(&p_sys->lock);
-    while (p_sys->paused)
-        vlc_cond_wait(&p_sys->wait, &p_sys->lock);
-    vlc_mutex_unlock(&p_sys->lock);
-
-    if (atomic_load(&p_sys->closing))
-        return VLC_EGENERIC;
-
     stream_t *p_ts = stream_UrlNew(s, segment->url);
     if (p_ts == NULL)
         return VLC_EGENERIC;



More information about the vlc-commits mailing list