Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
1f8bf1ef
Commit
1f8bf1ef
authored
Dec 28, 2011
by
Andrey Utkin
Committed by
Martin Storsjö
Dec 29, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
applehttpproto: Apply the same reload interval changes as for the demuxer
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
617475a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
applehttpproto.c
libavformat/applehttpproto.c
+12
-2
No files found.
libavformat/applehttpproto.c
View file @
1f8bf1ef
...
@@ -244,6 +244,7 @@ static int applehttp_read(URLContext *h, uint8_t *buf, int size)
...
@@ -244,6 +244,7 @@ static int applehttp_read(URLContext *h, uint8_t *buf, int size)
AppleHTTPContext
*
s
=
h
->
priv_data
;
AppleHTTPContext
*
s
=
h
->
priv_data
;
const
char
*
url
;
const
char
*
url
;
int
ret
;
int
ret
;
int64_t
reload_interval
;
start:
start:
if
(
s
->
seg_hd
)
{
if
(
s
->
seg_hd
)
{
...
@@ -256,12 +257,21 @@ start:
...
@@ -256,12 +257,21 @@ start:
s
->
seg_hd
=
NULL
;
s
->
seg_hd
=
NULL
;
s
->
cur_seq_no
++
;
s
->
cur_seq_no
++
;
}
}
reload_interval
=
s
->
n_segments
>
0
?
s
->
segments
[
s
->
n_segments
-
1
]
->
duration
:
s
->
target_duration
;
reload_interval
*=
1000000
;
retry:
retry:
if
(
!
s
->
finished
)
{
if
(
!
s
->
finished
)
{
int64_t
now
=
av_gettime
();
int64_t
now
=
av_gettime
();
if
(
now
-
s
->
last_load_time
>=
s
->
target_duration
*
1000000
)
if
(
now
-
s
->
last_load_time
>=
reload_interval
)
{
if
((
ret
=
parse_playlist
(
h
,
s
->
playlisturl
))
<
0
)
if
((
ret
=
parse_playlist
(
h
,
s
->
playlisturl
))
<
0
)
return
ret
;
return
ret
;
/* If we need to reload the playlist again below (if
* there's still no more segments), switch to a reload
* interval of half the target duration. */
reload_interval
=
s
->
target_duration
*
500000
;
}
}
}
if
(
s
->
cur_seq_no
<
s
->
start_seq_no
)
{
if
(
s
->
cur_seq_no
<
s
->
start_seq_no
)
{
av_log
(
h
,
AV_LOG_WARNING
,
av_log
(
h
,
AV_LOG_WARNING
,
...
@@ -272,7 +282,7 @@ retry:
...
@@ -272,7 +282,7 @@ retry:
if
(
s
->
cur_seq_no
-
s
->
start_seq_no
>=
s
->
n_segments
)
{
if
(
s
->
cur_seq_no
-
s
->
start_seq_no
>=
s
->
n_segments
)
{
if
(
s
->
finished
)
if
(
s
->
finished
)
return
AVERROR_EOF
;
return
AVERROR_EOF
;
while
(
av_gettime
()
-
s
->
last_load_time
<
s
->
target_duration
*
1000000
)
{
while
(
av_gettime
()
-
s
->
last_load_time
<
reload_interval
)
{
if
(
ff_check_interrupt
(
&
h
->
interrupt_callback
))
if
(
ff_check_interrupt
(
&
h
->
interrupt_callback
))
return
AVERROR_EXIT
;
return
AVERROR_EXIT
;
usleep
(
100
*
1000
);
usleep
(
100
*
1000
);
...
...
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