summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2018-01-11 02:27:20 +0100
committerwm4 <nfxjfg@googlemail.com>2018-01-15 12:37:30 +0100
commit43e1ccfea186080b1c4cb4cd1e59ac1a3c3dc446 (patch)
treecc30b3a22eecea157acf932627a716ce6096c26f /libavformat
parent856b7cae9f40c094be6a1dfa73eb57295838496c (diff)
http: cosmetics: reformat reconnect check for better readability
The condition was a bit too long, and most editors will break the line and turn it into an unreadable mess. Move out some of the conditions. This should not change the behavior.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/http.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index 510b23375a..aa80e314df 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -1449,12 +1449,18 @@ static int http_read_stream(URLContext *h, uint8_t *buf, int size)
return http_buf_read_compressed(h, buf, size);
#endif /* CONFIG_ZLIB */
read_ret = http_buf_read(h, buf, size);
- while ((read_ret < 0 && s->reconnect && (!h->is_streamed || s->reconnect_streamed) && s->filesize > 0 && s->off < s->filesize)
- || (read_ret == AVERROR_EOF && s->reconnect_at_eof && (!h->is_streamed || s->reconnect_streamed))) {
+ while (read_ret < 0) {
uint64_t target = h->is_streamed ? 0 : s->off;
if (read_ret == AVERROR_EXIT)
- return read_ret;
+ break;
+
+ if (h->is_streamed && !s->reconnect_streamed)
+ break;
+
+ if (!(s->reconnect && s->filesize > 0 && s->off < s->filesize) &&
+ !(s->reconnect_at_eof && read_ret == AVERROR_EOF))
+ break;
if (reconnect_delay > s->reconnect_delay_max)
return AVERROR(EIO);