From 9957cdbfd5ced5baae6ec97b97b08f1ad42aa4e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Sun, 6 Nov 2011 22:34:24 +0200 Subject: avformat: Use ff_check_interrupt --- libavformat/applehttpproto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavformat/applehttpproto.c') diff --git a/libavformat/applehttpproto.c b/libavformat/applehttpproto.c index 85f3cfcef4..1476ea28f2 100644 --- a/libavformat/applehttpproto.c +++ b/libavformat/applehttpproto.c @@ -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++; -- cgit v1.2.1 From 6f1b7b39449c4cd58e37d831d5d97bfd25eb26f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Sun, 6 Nov 2011 22:50:44 +0200 Subject: avio: Add an AVIOInterruptCB parameter to ffurl_open/ffurl_alloc Change all uses of these function to pass the relevant callback on. --- libavformat/applehttpproto.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libavformat/applehttpproto.c') diff --git a/libavformat/applehttpproto.c b/libavformat/applehttpproto.c index 1476ea28f2..e8d1b495ed 100644 --- a/libavformat/applehttpproto.c +++ b/libavformat/applehttpproto.c @@ -274,7 +274,8 @@ retry: } url = s->segments[s->cur_seq_no - s->start_seq_no]->url, av_log(h, AV_LOG_DEBUG, "opening %s\n", url); - ret = ffurl_open(&s->seg_hd, url, AVIO_FLAG_READ); + ret = ffurl_open(&s->seg_hd, url, AVIO_FLAG_READ, + &h->interrupt_callback); if (ret < 0) { if (ff_check_interrupt(&h->interrupt_callback)) return AVERROR_EXIT; -- cgit v1.2.1 From ddffc2fdc351d60ca190b016cccff4acff27823f Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 5 Nov 2011 10:04:04 +0100 Subject: avio: add support for passing options to protocols. Not used anywhere yet, support for passing options from avio_open() will follow. --- libavformat/applehttpproto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavformat/applehttpproto.c') diff --git a/libavformat/applehttpproto.c b/libavformat/applehttpproto.c index e8d1b495ed..2123423452 100644 --- a/libavformat/applehttpproto.c +++ b/libavformat/applehttpproto.c @@ -275,7 +275,7 @@ retry: url = s->segments[s->cur_seq_no - s->start_seq_no]->url, av_log(h, AV_LOG_DEBUG, "opening %s\n", url); ret = ffurl_open(&s->seg_hd, url, AVIO_FLAG_READ, - &h->interrupt_callback); + &h->interrupt_callback, NULL); if (ret < 0) { if (ff_check_interrupt(&h->interrupt_callback)) return AVERROR_EXIT; -- cgit v1.2.1 From 9d77a8faf9568f02daf06903559473efb4050c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Sun, 6 Nov 2011 23:11:29 +0200 Subject: avformat: Use avio_open2, pass the AVFormatContext interrupt_callback onwards Signed-off-by: Anton Khirnov --- libavformat/applehttpproto.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libavformat/applehttpproto.c') diff --git a/libavformat/applehttpproto.c b/libavformat/applehttpproto.c index 2123423452..0e64dadb39 100644 --- a/libavformat/applehttpproto.c +++ b/libavformat/applehttpproto.c @@ -114,7 +114,8 @@ static int parse_playlist(URLContext *h, const char *url) char line[1024]; const char *ptr; - if ((ret = avio_open(&in, url, AVIO_FLAG_READ)) < 0) + if ((ret = avio_open2(&in, url, AVIO_FLAG_READ, + &h->interrupt_callback, NULL)) < 0) return ret; read_chomp_line(in, line, sizeof(line)); -- cgit v1.2.1