URLContext *inner;
int seek_request;
- size_t seek_pos;
+ int64_t seek_pos;
int seek_whence;
int seek_completed;
int64_t seek_ret;
int io_error;
int io_eof_reached;
- size_t logical_pos;
- size_t logical_size;
+ int64_t logical_pos;
+ int64_t logical_size;
AVFifoBuffer *fifo;
pthread_cond_t cond_wakeup_main;
Context *c = h->priv_data;
AVFifoBuffer *fifo = c->fifo;
int ret = 0;
+ int64_t seek_ret;
while (1) {
int fifo_space, to_copy;
}
if (c->seek_request) {
- ret = ffurl_seek(c->inner, c->seek_pos, c->seek_whence);
- if (ret < 0) {
+ seek_ret = ffurl_seek(c->inner, c->seek_pos, c->seek_whence);
+ if (seek_ret < 0) {
c->io_eof_reached = 1;
- c->io_error = ret;
+ c->io_error = (int)seek_ret;
} else {
c->io_eof_reached = 0;
c->io_error = 0;
}
c->seek_completed = 1;
- c->seek_ret = ret;
+ c->seek_ret = seek_ret;
c->seek_request = 0;
av_fifo_reset(fifo);
c->interrupt_callback = h->interrupt_callback;
ret = ffurl_open(&c->inner, arg, flags, &interrupt_callback, options);
if (ret != 0) {
- av_log(h, AV_LOG_ERROR, "ffurl_open failed : %s, %s\n", strerror(ret), arg);
+ av_log(h, AV_LOG_ERROR, "ffurl_open failed : %s, %s\n", av_err2str(ret), arg);
goto url_fail;
}
ret = pthread_mutex_init(&c->mutex, NULL);
if (ret != 0) {
- av_log(h, AV_LOG_ERROR, "pthread_mutex_init failed : %s\n", strerror(ret));
+ av_log(h, AV_LOG_ERROR, "pthread_mutex_init failed : %s\n", av_err2str(ret));
goto mutex_fail;
}
ret = pthread_cond_init(&c->cond_wakeup_main, NULL);
if (ret != 0) {
- av_log(h, AV_LOG_ERROR, "pthread_cond_init failed : %s\n", strerror(ret));
+ av_log(h, AV_LOG_ERROR, "pthread_cond_init failed : %s\n", av_err2str(ret));
goto cond_wakeup_main_fail;
}
ret = pthread_cond_init(&c->cond_wakeup_background, NULL);
if (ret != 0) {
- av_log(h, AV_LOG_ERROR, "pthread_cond_init failed : %s\n", strerror(ret));
+ av_log(h, AV_LOG_ERROR, "pthread_cond_init failed : %s\n", av_err2str(ret));
goto cond_wakeup_background_fail;
}
ret = pthread_create(&c->async_buffer_thread, NULL, async_buffer_task, h);
if (ret) {
- av_log(h, AV_LOG_ERROR, "pthread_create failed : %s\n", strerror(ret));
+ av_log(h, AV_LOG_ERROR, "pthread_create failed : %s\n", av_err2str(ret));
goto thread_fail;
}
ret = pthread_join(c->async_buffer_thread, NULL);
if (ret != 0)
- av_log(h, AV_LOG_ERROR, "pthread_join(): %s\n", strerror(ret));
+ av_log(h, AV_LOG_ERROR, "pthread_join(): %s\n", av_err2str(ret));
pthread_cond_destroy(&c->cond_wakeup_background);
pthread_cond_destroy(&c->cond_wakeup_main);
av_log(h, AV_LOG_TRACE, "async_seek: fask_seek %"PRId64" from %d dist:%d/%d\n",
new_logical_pos, (int)c->logical_pos,
(int)(new_logical_pos - c->logical_pos), fifo_size);
- async_read_internal(h, NULL, new_logical_pos - c->logical_pos, 1, fifo_do_not_copy_func);
+ async_read_internal(h, NULL, (int)(new_logical_pos - c->logical_pos), 1, fifo_do_not_copy_func);
return c->logical_pos;
} else if (c->logical_size <= 0) {
/* can not seek */
typedef struct TestContext {
AVClass *class;
- size_t logical_pos;
- size_t logical_size;
+ int64_t logical_pos;
+ int64_t logical_size;
} TestContext;
static int async_test_open(URLContext *h, const char *arg, int flags, AVDictionary **options)