Signed-off-by: Artjom Vejsel <akawo...@gmail.com>
---

Hello.

I've faced an error while playing when downloading just stopped. It can be even 
few times at one film.
After digging into source I've finished with knowledge that HTTP connection 
made only once and if it was not successfull, HTTP interface just report
with an error.
I tried to change this behaviour to try few times and that solve my problem.

 libavformat/http.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/libavformat/http.c b/libavformat/http.c
index 4fdb2f13f2..9afa885423 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -259,11 +259,19 @@ redo:
     cur_auth_type       = s->auth_state.auth_type;
     cur_proxy_auth_type = s->auth_state.auth_type;
 
+    attempts++;
+
     location_changed = http_open_cnx_internal(h, options);
-    if (location_changed < 0)
-        goto fail;
+    if (location_changed < 0) {
+        if (attempts < 5) {
+            av_log(h, AV_LOG_ERROR, "Couldn't get HTTP resource, 
retrying...\n");
+            if (s->hd)
+                ffurl_closep(&s->hd);
+            goto redo;
+        } else
+            goto fail;
+    }
 
-    attempts++;
     if (s->http_code == 401) {
         if ((cur_auth_type == HTTP_AUTH_NONE || s->auth_state.stale) &&
             s->auth_state.auth_type != HTTP_AUTH_NONE && attempts < 4) {
-- 
2.18.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to