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
9957cdbf
Commit
9957cdbf
authored
Nov 06, 2011
by
Martin Storsjö
Committed by
Anton Khirnov
Nov 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat: Use ff_check_interrupt
parent
c4a090dd
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
13 additions
and
10 deletions
+13
-10
applehttp.c
libavformat/applehttp.c
+4
-1
applehttpproto.c
libavformat/applehttpproto.c
+2
-2
avio.c
libavformat/avio.c
+1
-1
rtpproto.c
libavformat/rtpproto.c
+1
-1
rtsp.c
libavformat/rtsp.c
+1
-1
tcp.c
libavformat/tcp.c
+2
-2
tls.c
libavformat/tls.c
+1
-1
utils.c
libavformat/utils.c
+1
-1
No files found.
libavformat/applehttp.c
View file @
9957cdbf
...
...
@@ -99,6 +99,7 @@ typedef struct AppleHTTPContext {
int
cur_seq_no
;
int
end_of_segment
;
int
first_packet
;
AVIOInterruptCB
*
interrupt_callback
;
}
AppleHTTPContext
;
static
int
read_chomp_line
(
AVIOContext
*
s
,
char
*
buf
,
int
maxlen
)
...
...
@@ -388,7 +389,7 @@ reload:
return
AVERROR_EOF
;
while
(
av_gettime
()
-
v
->
last_load_time
<
v
->
target_duration
*
1000000
)
{
if
(
url_interrupt_cb
(
))
if
(
ff_check_interrupt
(
c
->
interrupt_callback
))
return
AVERROR_EXIT
;
usleep
(
100
*
1000
);
}
...
...
@@ -433,6 +434,8 @@ static int applehttp_read_header(AVFormatContext *s, AVFormatParameters *ap)
AppleHTTPContext
*
c
=
s
->
priv_data
;
int
ret
=
0
,
i
,
j
,
stream_offset
=
0
;
c
->
interrupt_callback
=
&
s
->
interrupt_callback
;
if
((
ret
=
parse_playlist
(
c
,
s
->
filename
,
NULL
,
s
->
pb
))
<
0
)
goto
fail
;
...
...
libavformat/applehttpproto.c
View file @
9957cdbf
...
...
@@ -266,7 +266,7 @@ retry:
if
(
s
->
finished
)
return
AVERROR_EOF
;
while
(
av_gettime
()
-
s
->
last_load_time
<
s
->
target_duration
*
1000000
)
{
if
(
url_interrupt_cb
(
))
if
(
ff_check_interrupt
(
&
h
->
interrupt_callback
))
return
AVERROR_EXIT
;
usleep
(
100
*
1000
);
}
...
...
@@ -276,7 +276,7 @@ retry:
av_log
(
h
,
AV_LOG_DEBUG
,
"opening %s
\n
"
,
url
);
ret
=
ffurl_open
(
&
s
->
seg_hd
,
url
,
AVIO_FLAG_READ
);
if
(
ret
<
0
)
{
if
(
url_interrupt_cb
(
))
if
(
ff_check_interrupt
(
&
h
->
interrupt_callback
))
return
AVERROR_EXIT
;
av_log
(
h
,
AV_LOG_WARNING
,
"Unable to open %s
\n
"
,
url
);
s
->
cur_seq_no
++
;
...
...
libavformat/avio.c
View file @
9957cdbf
...
...
@@ -284,7 +284,7 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int
if
(
ret
)
fast_retries
=
FFMAX
(
fast_retries
,
2
);
len
+=
ret
;
if
(
url_interrupt_cb
(
))
if
(
ff_check_interrupt
(
&
h
->
interrupt_callback
))
return
AVERROR_EXIT
;
}
return
len
;
...
...
libavformat/rtpproto.c
View file @
9957cdbf
...
...
@@ -226,7 +226,7 @@ static int rtp_read(URLContext *h, uint8_t *buf, int size)
struct
pollfd
p
[
2
]
=
{{
s
->
rtp_fd
,
POLLIN
,
0
},
{
s
->
rtcp_fd
,
POLLIN
,
0
}};
for
(;;)
{
if
(
url_interrupt_cb
(
))
if
(
ff_check_interrupt
(
&
h
->
interrupt_callback
))
return
AVERROR_EXIT
;
/* build fdset to listen to RTP and RTCP packets */
n
=
poll
(
p
,
2
,
100
);
...
...
libavformat/rtsp.c
View file @
9957cdbf
...
...
@@ -1619,7 +1619,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
struct
pollfd
*
p
=
rt
->
p
;
for
(;;)
{
if
(
url_interrupt_cb
(
))
if
(
ff_check_interrupt
(
&
s
->
interrupt_callback
))
return
AVERROR_EXIT
;
if
(
wait_end
&&
wait_end
-
av_gettime
()
<
0
)
return
AVERROR
(
EAGAIN
);
...
...
libavformat/tcp.c
View file @
9957cdbf
...
...
@@ -100,7 +100,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
struct
pollfd
p
=
{
fd
,
POLLOUT
,
0
};
ret
=
ff_neterrno
();
if
(
ret
==
AVERROR
(
EINTR
))
{
if
(
url_interrupt_cb
(
))
{
if
(
ff_check_interrupt
(
&
h
->
interrupt_callback
))
{
ret
=
AVERROR_EXIT
;
goto
fail1
;
}
...
...
@@ -112,7 +112,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
/* wait until we are connected or until abort */
while
(
timeout
--
)
{
if
(
url_interrupt_cb
(
))
{
if
(
ff_check_interrupt
(
&
h
->
interrupt_callback
))
{
ret
=
AVERROR_EXIT
;
goto
fail1
;
}
...
...
libavformat/tls.c
View file @
9957cdbf
...
...
@@ -97,7 +97,7 @@ static int do_tls_poll(URLContext *h, int ret)
int
n
=
poll
(
&
p
,
1
,
100
);
if
(
n
>
0
)
break
;
if
(
url_interrupt_cb
(
))
if
(
ff_check_interrupt
(
&
h
->
interrupt_callback
))
return
AVERROR
(
EINTR
);
}
return
0
;
...
...
libavformat/utils.c
View file @
9957cdbf
...
...
@@ -2310,7 +2310,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
count
=
0
;
read_size
=
0
;
for
(;;)
{
if
(
url_interrupt_cb
(
)){
if
(
ff_check_interrupt
(
&
ic
->
interrupt_callback
)){
ret
=
AVERROR_EXIT
;
av_log
(
ic
,
AV_LOG_DEBUG
,
"interrupted
\n
"
);
break
;
...
...
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