struct stream_sys_t
{
- vlc_url_t m3u8; /* M3U8 url */
+ vlc_url_t m3u8; /* M3U8 url */
+ vlc_thread_t thread; /* Thread function */
/* */
- vlc_array_t *hls_stream;/* bandwidth adaptation */
- uint64_t bandwidth; /* measured bandwidth (bits per second) */
+ vlc_array_t *hls_stream; /* bandwidth adaptation */
+ uint64_t bandwidth; /* measured bandwidth (bits per second) */
/* Download */
struct hls_download_s
static int hls_Download(stream_t *s, segment_t *segment);
-static void* hls_Thread(vlc_object_t *);
+static void* hls_Thread(void *);
static segment_t *segment_GetSegment(hls_stream_t *hls, int wanted);
static void segment_Free(segment_t *segment);
return VLC_SUCCESS;
}
-static void* hls_Thread(vlc_object_t *p_this)
+static void* hls_Thread(void *p_this)
{
stream_t *s = (stream_t *)p_this;
stream_sys_t *p_sys = s->p_sys;
- int canc = vlc_savecancel();
-
while (vlc_object_alive(s))
{
hls_stream_t *hls = hls_Get(p_sys->hls_stream, p_sys->download.stream);
vlc_mutex_unlock(&p_sys->download.lock_wait);
}
- vlc_restorecancel(canc);
return NULL;
}
vlc_mutex_init(&p_sys->download.lock_wait);
vlc_cond_init(&p_sys->download.wait);
- if (vlc_thread_create(s, hls_Thread, VLC_THREAD_PRIORITY_INPUT))
+ if (vlc_clone(&p_sys->thread, hls_Thread, s, VLC_THREAD_PRIORITY_INPUT))
{
goto fail_thread;
}
vlc_mutex_unlock(&p_sys->download.lock_wait);
/* */
- vlc_thread_join(s);
+ vlc_join(p_sys->thread, NULL);
vlc_mutex_destroy(&p_sys->download.lock_wait);
vlc_cond_destroy(&p_sys->download.wait);