Commit 3938b5f5 authored by Jean-Paul Saman's avatar Jean-Paul Saman

stream_filter/httplive.c: rename segment->length to segment->duration

Rename wrongly named segment->length to segment->duration.
parent 5cfeb579
...@@ -61,7 +61,7 @@ vlc_module_end() ...@@ -61,7 +61,7 @@ vlc_module_end()
typedef struct segment_s typedef struct segment_s
{ {
int sequence; /* unique sequence number */ int sequence; /* unique sequence number */
int length; /* segment duration (seconds) */ int duration; /* segment duration (seconds) */
uint64_t size; /* segment size in bytes */ uint64_t size; /* segment size in bytes */
uint64_t bandwidth; /* bandwidth usage of segments (bits per second)*/ uint64_t bandwidth; /* bandwidth usage of segments (bits per second)*/
...@@ -240,7 +240,7 @@ static segment_t *segment_New(hls_stream_t* hls, int duration, char *uri) ...@@ -240,7 +240,7 @@ static segment_t *segment_New(hls_stream_t* hls, int duration, char *uri)
if (segment == NULL) if (segment == NULL)
return NULL; return NULL;
segment->length = duration; /* seconds */ segment->duration = duration; /* seconds */
segment->size = 0; /* bytes */ segment->size = 0; /* bytes */
segment->sequence = 0; segment->sequence = 0;
segment->bandwidth = 0; segment->bandwidth = 0;
...@@ -782,7 +782,7 @@ static int parse_HTTPLiveStreaming(stream_t *s) ...@@ -782,7 +782,7 @@ static int parse_HTTPLiveStreaming(stream_t *s)
for (int i = 0; i < num; i++) for (int i = 0; i < num; i++)
{ {
segment_t *segment = segment_GetSegment(hls, i); segment_t *segment = segment_GetSegment(hls, i);
if (segment && segment->length >= hls->duration) if (segment && segment->duration >= hls->duration)
ok++; ok++;
} }
if (ok < 3) if (ok < 3)
...@@ -1485,7 +1485,7 @@ static uint64_t GetStreamSize(stream_t *s) ...@@ -1485,7 +1485,7 @@ static uint64_t GetStreamSize(stream_t *s)
if (segment) if (segment)
{ {
length += (segment->size > 0) ? segment->size : length += (segment->size > 0) ? segment->size :
(segment->length * hls->bandwidth); (segment->duration * hls->bandwidth);
} }
} }
...@@ -1548,7 +1548,7 @@ static int segment_Seek(stream_t *s, uint64_t pos) ...@@ -1548,7 +1548,7 @@ static int segment_Seek(stream_t *s, uint64_t pos)
{ {
/* FIXME: seeking is weird when seeking in segments /* FIXME: seeking is weird when seeking in segments
that have not been downloaded yet */ that have not been downloaded yet */
length += segment->length * hls->bandwidth; length += segment->duration * hls->bandwidth;
if (!b_found && (pos <= length)) if (!b_found && (pos <= length))
{ {
......
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