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
1555e3ce
Commit
1555e3ce
authored
Feb 02, 2012
by
Hugo Beauzée-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hls: Don't download the same segment twice when prefetching.
This makes the playback start faster.
parent
c0b3a6f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
18 deletions
+4
-18
modules/stream_filter/httplive.c
modules/stream_filter/httplive.c
+4
-18
No files found.
modules/stream_filter/httplive.c
View file @
1555e3ce
...
...
@@ -1724,35 +1724,21 @@ static void* hls_Reload(void *p_this)
static
int
Prefetch
(
stream_t
*
s
,
int
*
current
)
{
stream_sys_t
*
p_sys
=
s
->
p_sys
;
int
stream
;
int
stream
=
*
current
;
/* Try to pick best matching stream */
;
again:
stream
=
*
current
;
hls_stream_t
*
hls
=
hls_Get
(
p_sys
->
hls_stream
,
*
current
);
hls_stream_t
*
hls
=
hls_Get
(
p_sys
->
hls_stream
,
stream
);
if
(
hls
==
NULL
)
return
VLC_EGENERIC
;
segment_t
*
segment
=
segment_GetSegment
(
hls
,
p_sys
->
download
.
segment
);
if
(
segment
==
NULL
)
return
VLC_EGENERIC
;
if
(
hls_DownloadSegmentData
(
s
,
hls
,
segment
,
current
)
!=
VLC_SUCCESS
)
return
VLC_EGENERIC
;
/* Found better bandwidth match, try again */
if
(
*
current
!=
stream
)
goto
again
;
/* Download first 2 segments of this HLS stream */
stream
=
*
current
;
for
(
int
i
=
0
;
i
<
2
;
i
++
)
{
segment_t
*
segment
=
segment_GetSegment
(
hls
,
p_sys
->
download
.
segment
);
if
(
segment
==
NULL
)
return
VLC_EGENERIC
;
/* It is useless to lock the segment here, as Prefetch is called before
download and playlit thread are started. */
if
(
segment
->
data
)
{
p_sys
->
download
.
segment
++
;
...
...
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