diff options
author | Derek Buitenhuis | 2016-04-18 15:47:05 +0100 |
---|---|---|
committer | Derek Buitenhuis | 2016-04-18 15:47:54 +0100 |
commit | 299d4f9428c2f4d16a1575d80d80caacdd850606 (patch) | |
tree | 79ed46565ed50be08459daa2d66f5f5789fb625d /libavformat/avio.c | |
parent | 4eef36a4f6db1feb9d628337bd96e07a9b482c1a (diff) | |
parent | ccea588f831906084b8c8235222920e6984beb72 (diff) |
Merge commit 'ccea588f831906084b8c8235222920e6984beb72'
* commit 'ccea588f831906084b8c8235222920e6984beb72':
avio: Add an option 'rw_timeout'
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavformat/avio.c')
-rw-r--r-- | libavformat/avio.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/avio.c b/libavformat/avio.c index 4b10dd8f39..7e68c9a6e9 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -56,6 +56,7 @@ static void *urlcontext_child_next(void *obj, void *prev) static const AVOption options[] = { {"protocol_whitelist", "List of protocols that are allowed to be used", OFFSET(protocol_whitelist), AV_OPT_TYPE_STRING, { .str = NULL }, CHAR_MIN, CHAR_MAX, D }, {"protocol_blacklist", "List of protocols that are not allowed to be used", OFFSET(protocol_blacklist), AV_OPT_TYPE_STRING, { .str = NULL }, CHAR_MIN, CHAR_MAX, D }, + {"rw_timeout", "Timeout for IO operations (in microseconds)", offsetof(URLContext, rw_timeout), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_DECODING_PARAM }, { NULL } }; @@ -388,8 +389,10 @@ static inline int retry_transfer_wrapper(URLContext *h, uint8_t *buf, } } else if (ret < 1) return (ret < 0 && ret != AVERROR_EOF) ? ret : len; - if (ret) + if (ret) { fast_retries = FFMAX(fast_retries, 2); + wait_since = 0; + } len += ret; } return len; |