Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
e2942aee
Commit
e2942aee
authored
Feb 03, 2012
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hls: Ensure streams are sorted by bandwidth.
THe standard doesn't guaranty anything, but the code assumes it.
parent
1555e3ce
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
modules/stream_filter/httplive.c
modules/stream_filter/httplive.c
+11
-0
No files found.
modules/stream_filter/httplive.c
View file @
e2942aee
...
...
@@ -953,6 +953,13 @@ static int parse_Discontinuity(stream_t *s, hls_stream_t *hls, char *p_read)
return
VLC_SUCCESS
;
}
static
int
hls_CompareStreams
(
const
void
*
a
,
const
void
*
b
)
{
hls_stream_t
*
stream_a
=
*
(
hls_stream_t
**
)
a
;
hls_stream_t
*
stream_b
=
*
(
hls_stream_t
**
)
b
;
return
stream_a
->
bandwidth
>
stream_b
->
bandwidth
;
}
/* The http://tools.ietf.org/html/draft-pantos-http-live-streaming-04#page-8
* document defines the following new tags: EXT-X-TARGETDURATION,
* EXT-X-MEDIA-SEQUENCE, EXT-X-KEY, EXT-X-PROGRAM-DATE-TIME, EXT-X-
...
...
@@ -1977,6 +1984,10 @@ static int Open(vlc_object_t *p_this)
goto
fail
;
}
free
(
buffer
);
/* HLS standard doesn't provide any guaranty about streams
being sorted by bandwidth, so we sort them */
qsort
(
p_sys
->
hls_stream
->
pp_elems
,
p_sys
->
hls_stream
->
i_count
,
sizeof
(
hls_stream_t
*
),
&
hls_CompareStreams
);
/* Choose first HLS stream to start with */
int
current
=
p_sys
->
playback
.
stream
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment