summaryrefslogtreecommitdiff
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r--libavformat/rtsp.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 68083ae2ac..18ec8a5edc 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1159,7 +1159,8 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
"?localport=%d", j);
/* we will use two ports per rtp stream (rtp and rtcp) */
j += 2;
- if (ffurl_open(&rtsp_st->rtp_handle, buf, AVIO_FLAG_READ_WRITE) == 0)
+ if (ffurl_open(&rtsp_st->rtp_handle, buf, AVIO_FLAG_READ_WRITE,
+ &s->interrupt_callback, NULL) == 0)
goto rtp_opened;
}
}
@@ -1306,7 +1307,8 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
namebuf, sizeof(namebuf), NULL, 0, NI_NUMERICHOST);
ff_url_join(url, sizeof(url), "rtp", NULL, namebuf,
port, "?ttl=%d", ttl);
- if (ffurl_open(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ_WRITE) < 0) {
+ if (ffurl_open(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ_WRITE,
+ &s->interrupt_callback, NULL) < 0) {
err = AVERROR_INVALIDDATA;
goto fail;
}
@@ -1450,7 +1452,8 @@ redirect:
av_get_random_seed(), av_get_random_seed());
/* GET requests */
- if (ffurl_alloc(&rt->rtsp_hd, httpname, AVIO_FLAG_READ) < 0) {
+ if (ffurl_alloc(&rt->rtsp_hd, httpname, AVIO_FLAG_READ,
+ &s->interrupt_callback) < 0) {
err = AVERROR(EIO);
goto fail;
}
@@ -1465,13 +1468,14 @@ redirect:
av_opt_set(rt->rtsp_hd->priv_data, "headers", headers, 0);
/* complete the connection */
- if (ffurl_connect(rt->rtsp_hd)) {
+ if (ffurl_connect(rt->rtsp_hd, NULL)) {
err = AVERROR(EIO);
goto fail;
}
/* POST requests */
- if (ffurl_alloc(&rt->rtsp_hd_out, httpname, AVIO_FLAG_WRITE) < 0 ) {
+ if (ffurl_alloc(&rt->rtsp_hd_out, httpname, AVIO_FLAG_WRITE,
+ &s->interrupt_callback) < 0 ) {
err = AVERROR(EIO);
goto fail;
}
@@ -1507,14 +1511,15 @@ redirect:
ff_http_init_auth_state(rt->rtsp_hd_out, rt->rtsp_hd);
/* complete the connection */
- if (ffurl_connect(rt->rtsp_hd_out)) {
+ if (ffurl_connect(rt->rtsp_hd_out, NULL)) {
err = AVERROR(EIO);
goto fail;
}
} else {
/* open the tcp connection */
ff_url_join(tcpname, sizeof(tcpname), "tcp", NULL, host, port, NULL);
- if (ffurl_open(&rt->rtsp_hd, tcpname, AVIO_FLAG_READ_WRITE) < 0) {
+ if (ffurl_open(&rt->rtsp_hd, tcpname, AVIO_FLAG_READ_WRITE,
+ &s->interrupt_callback, NULL) < 0) {
err = AVERROR(EIO);
goto fail;
}
@@ -1619,7 +1624,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);
@@ -1862,7 +1867,8 @@ static int sdp_read_header(AVFormatContext *s, AVFormatParameters *ap)
"?localport=%d&ttl=%d&connect=%d", rtsp_st->sdp_port,
rtsp_st->sdp_ttl,
rt->rtsp_flags & RTSP_FLAG_FILTER_SRC ? 1 : 0);
- if (ffurl_open(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ_WRITE) < 0) {
+ if (ffurl_open(&rtsp_st->rtp_handle, url, AVIO_FLAG_READ_WRITE,
+ &s->interrupt_callback, NULL) < 0) {
err = AVERROR_INVALIDDATA;
goto fail;
}
@@ -1926,7 +1932,8 @@ static int rtp_read_header(AVFormatContext *s,
if (!ff_network_init())
return AVERROR(EIO);
- ret = ffurl_open(&in, s->filename, AVIO_FLAG_READ);
+ ret = ffurl_open(&in, s->filename, AVIO_FLAG_READ,
+ &s->interrupt_callback, NULL);
if (ret)
goto fail;