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)
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);
}
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;
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);
}
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++;
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;
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);
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);
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;
}
/* 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;
}
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;
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;