Commit cda18d88 authored by Jean-Paul Saman's avatar Jean-Paul Saman

stream_filter/httplive.c: Rename p_sys->*.current to p_sys->*.stream

Rename p_sys->download.current and p_sys->playback.current to
p_sys->download.stream and p_sys->playback.stream.
parent 7b9b81d9
...@@ -106,7 +106,7 @@ struct stream_sys_t ...@@ -106,7 +106,7 @@ struct stream_sys_t
/* Download */ /* Download */
struct hls_download_s struct hls_download_s
{ {
int current; /* current hls_stream */ int stream; /* current hls_stream */
int segment; /* current segment for downloading */ int segment; /* current segment for downloading */
int seek; /* segment requested by seek (default -1) */ int seek; /* segment requested by seek (default -1) */
vlc_mutex_t lock_wait; /* protect segment download counter */ vlc_mutex_t lock_wait; /* protect segment download counter */
...@@ -117,7 +117,7 @@ struct stream_sys_t ...@@ -117,7 +117,7 @@ struct stream_sys_t
struct hls_playback_s struct hls_playback_s
{ {
uint64_t offset; /* current offset in media */ uint64_t offset; /* current offset in media */
int current; /* current hls_stream */ int stream; /* current hls_stream */
int segment; /* current segment for playback */ int segment; /* current segment for playback */
} playback; } playback;
...@@ -1208,7 +1208,7 @@ static void* hls_Thread(vlc_object_t *p_this) ...@@ -1208,7 +1208,7 @@ static void* hls_Thread(vlc_object_t *p_this)
while (vlc_object_alive(p_this)) while (vlc_object_alive(p_this))
{ {
hls_stream_t *hls = hls_Get(p_sys->hls_stream, p_sys->download.current); hls_stream_t *hls = hls_Get(p_sys->hls_stream, p_sys->download.stream);
assert(hls); assert(hls);
/* Sliding window (~60 seconds worth of movie) */ /* Sliding window (~60 seconds worth of movie) */
...@@ -1273,7 +1273,7 @@ static void* hls_Thread(vlc_object_t *p_this) ...@@ -1273,7 +1273,7 @@ static void* hls_Thread(vlc_object_t *p_this)
vlc_mutex_unlock(&hls->lock); vlc_mutex_unlock(&hls->lock);
if ((segment != NULL) && if ((segment != NULL) &&
(Download(s, hls, segment, &p_sys->download.current) != VLC_SUCCESS)) (Download(s, hls, segment, &p_sys->download.stream) != VLC_SUCCESS))
{ {
if (!vlc_object_alive(p_this)) break; if (!vlc_object_alive(p_this)) break;
...@@ -1566,7 +1566,7 @@ static int Open(vlc_object_t *p_this) ...@@ -1566,7 +1566,7 @@ static int Open(vlc_object_t *p_this)
} }
/* Choose first HLS stream to start with */ /* Choose first HLS stream to start with */
int current = p_sys->playback.current = 0; int current = p_sys->playback.stream = 0;
p_sys->playback.segment = p_sys->download.segment = p_sys->playback.segment = p_sys->download.segment =
p_sys->b_live ? live_ChooseSegment(s, current) : 0; p_sys->b_live ? live_ChooseSegment(s, current) : 0;
...@@ -1592,8 +1592,8 @@ static int Open(vlc_object_t *p_this) ...@@ -1592,8 +1592,8 @@ static int Open(vlc_object_t *p_this)
((mtime_t)hls->duration * UINT64_C(1000000)); ((mtime_t)hls->duration * UINT64_C(1000000));
} }
p_sys->download.current = current; p_sys->download.stream = current;
p_sys->playback.current = current; p_sys->playback.stream = current;
p_sys->download.seek = -1; p_sys->download.seek = -1;
p_sys->thread->s = s; p_sys->thread->s = s;
...@@ -1663,7 +1663,7 @@ static segment_t *GetSegment(stream_t *s) ...@@ -1663,7 +1663,7 @@ static segment_t *GetSegment(stream_t *s)
segment_t *segment = NULL; segment_t *segment = NULL;
/* Is this segment of the current HLS stream ready? */ /* Is this segment of the current HLS stream ready? */
hls_stream_t *hls = hls_Get(p_sys->hls_stream, p_sys->playback.current); hls_stream_t *hls = hls_Get(p_sys->hls_stream, p_sys->playback.stream);
if (hls != NULL) if (hls != NULL)
{ {
vlc_mutex_lock(&hls->lock); vlc_mutex_lock(&hls->lock);
...@@ -1707,7 +1707,7 @@ static segment_t *GetSegment(stream_t *s) ...@@ -1707,7 +1707,7 @@ static segment_t *GetSegment(stream_t *s)
if ((segment->data != NULL) && if ((segment->data != NULL) &&
(p_sys->playback.segment < i_segment)) (p_sys->playback.segment < i_segment))
{ {
p_sys->playback.current = i_stream; p_sys->playback.stream = i_stream;
p_sys->b_cache = hls->b_cache; p_sys->b_cache = hls->b_cache;
vlc_mutex_unlock(&hls->lock); vlc_mutex_unlock(&hls->lock);
goto check; goto check;
...@@ -1786,7 +1786,7 @@ static ssize_t hls_Read(stream_t *s, uint8_t *p_read, unsigned int i_read) ...@@ -1786,7 +1786,7 @@ static ssize_t hls_Read(stream_t *s, uint8_t *p_read, unsigned int i_read)
if (segment->size == segment->data->i_buffer) if (segment->size == segment->data->i_buffer)
msg_Info(s, "playing segment %d from stream %d", msg_Info(s, "playing segment %d from stream %d",
segment->sequence, p_sys->playback.current); segment->sequence, p_sys->playback.stream);
ssize_t len = -1; ssize_t len = -1;
if (i_read <= segment->data->i_buffer) if (i_read <= segment->data->i_buffer)
...@@ -1847,7 +1847,7 @@ again: ...@@ -1847,7 +1847,7 @@ again:
if (segment == NULL) if (segment == NULL)
{ {
msg_Err(s, "segment %d should have been available (stream %d)", msg_Err(s, "segment %d should have been available (stream %d)",
p_sys->playback.segment, p_sys->playback.current); p_sys->playback.segment, p_sys->playback.stream);
return 0; /* eof? */ return 0; /* eof? */
} }
...@@ -1885,7 +1885,7 @@ static bool hls_MaySeek(stream_t *s) ...@@ -1885,7 +1885,7 @@ static bool hls_MaySeek(stream_t *s)
if (p_sys->hls_stream == NULL) if (p_sys->hls_stream == NULL)
return false; return false;
hls_stream_t *hls = hls_Get(p_sys->hls_stream, p_sys->playback.current); hls_stream_t *hls = hls_Get(p_sys->hls_stream, p_sys->playback.stream);
if (hls == NULL) return false; if (hls == NULL) return false;
if (p_sys->b_live) if (p_sys->b_live)
...@@ -1909,7 +1909,7 @@ static uint64_t GetStreamSize(stream_t *s) ...@@ -1909,7 +1909,7 @@ static uint64_t GetStreamSize(stream_t *s)
if (p_sys->b_live) if (p_sys->b_live)
return 0; return 0;
hls_stream_t *hls = hls_Get(p_sys->hls_stream, p_sys->playback.current); hls_stream_t *hls = hls_Get(p_sys->hls_stream, p_sys->playback.stream);
if (hls == NULL) return 0; if (hls == NULL) return 0;
vlc_mutex_lock(&hls->lock); vlc_mutex_lock(&hls->lock);
...@@ -1923,7 +1923,7 @@ static int segment_Seek(stream_t *s, uint64_t pos) ...@@ -1923,7 +1923,7 @@ static int segment_Seek(stream_t *s, uint64_t pos)
{ {
stream_sys_t *p_sys = s->p_sys; stream_sys_t *p_sys = s->p_sys;
hls_stream_t *hls = hls_Get(p_sys->hls_stream, p_sys->playback.current); hls_stream_t *hls = hls_Get(p_sys->hls_stream, p_sys->playback.stream);
if (hls == NULL) if (hls == NULL)
return VLC_EGENERIC; return VLC_EGENERIC;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment