second to handle timeouts */
do {
ret = poll(poll_table, poll_entry - poll_table, delay);
- } while (ret == -1);
+ if (ret < 0 && errno != EAGAIN && errno != EINTR)
+ return -1;
+ } while (ret <= 0);
cur_time = gettime_ms();
return -EPIPE;
s->buf_ptr = s->buffer;
s->buf_end = s->buffer;
- s->seek(s->opaque, offset, SEEK_SET);
+ if (s->seek(s->opaque, offset, SEEK_SET) == (offset_t)-EPIPE)
+ return -EPIPE;
s->pos = offset;
}
s->eof_reached = 0;
static int url_seek_packet(void *opaque, int64_t offset, int whence)
{
URLContext *h = opaque;
- url_seek(h, offset, whence);
- return 0;
+ return url_seek(h, offset, whence);
+ //return 0;
}
int url_fdopen(ByteIOContext *s, URLContext *h)
fst = av_mallocz(sizeof(FFMStream));
if (!fst)
goto fail;
+ av_set_pts_info(st, 64, 1, 1000000);
st->priv_data = fst;
codec = &st->codec;
if (!fmt) {
/* read probe data */
pd->buf_size = get_buffer(pb, buf, PROBE_BUF_SIZE);
- url_fseek(pb, 0, SEEK_SET);
+ if (url_fseek(pb, 0, SEEK_SET) == (offset_t)-EPIPE) {
+ url_fclose(pb);
+ if (url_fopen(pb, filename, URL_RDONLY) < 0) {
+ err = AVERROR_IO;
+ goto fail;
+ }
+ }
}
}