Commit 43e1ccfe authored by wm4's avatar wm4

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.
parent 856b7cae
...@@ -1449,12 +1449,18 @@ static int http_read_stream(URLContext *h, uint8_t *buf, int size) ...@@ -1449,12 +1449,18 @@ static int http_read_stream(URLContext *h, uint8_t *buf, int size)
return http_buf_read_compressed(h, buf, size); return http_buf_read_compressed(h, buf, size);
#endif /* CONFIG_ZLIB */ #endif /* CONFIG_ZLIB */
read_ret = http_buf_read(h, buf, size); 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) while (read_ret < 0) {
|| (read_ret == AVERROR_EOF && s->reconnect_at_eof && (!h->is_streamed || s->reconnect_streamed))) {
uint64_t target = h->is_streamed ? 0 : s->off; uint64_t target = h->is_streamed ? 0 : s->off;
if (read_ret == AVERROR_EXIT) 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) if (reconnect_delay > s->reconnect_delay_max)
return AVERROR(EIO); return AVERROR(EIO);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment