]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/http.c
Set subtitle codec id correctly, i hope this does not break anything.
[ffmpeg] / libavformat / http.c
index 0d9591e3a63af2917cb91498798e67a675a524d3..4dcc7d2548a8880aa442707a65a8d314473f9bbc 100644 (file)
@@ -21,6 +21,7 @@
 #include "avformat.h"
 #include <unistd.h>
 #include "network.h"
+#include "os_support.h"
 
 #include "base64.h"
 #include "avstring.h"
@@ -101,7 +102,7 @@ static int http_open_cnx(URLContext *h)
         /* url moved, get next */
         url_close(hd);
         if (redirects++ >= MAX_REDIRECTS)
-            return AVERROR_IO;
+            return AVERROR(EIO);
         location_changed = 0;
         goto redo;
     }
@@ -109,7 +110,7 @@ static int http_open_cnx(URLContext *h)
  fail:
     if (hd)
         url_close(hd);
-    return AVERROR_IO;
+    return AVERROR(EIO);
 }
 
 static int http_open(URLContext *h, const char *uri, int flags)
@@ -139,7 +140,7 @@ static int http_getc(HTTPContext *s)
     if (s->buf_ptr >= s->buf_end) {
         len = url_read(s->hd, s->buffer, BUFFER_SIZE);
         if (len < 0) {
-            return AVERROR_IO;
+            return AVERROR(EIO);
         } else if (len == 0) {
             return -1;
         } else {
@@ -237,7 +238,7 @@ static int http_connect(URLContext *h, const char *path, const char *hoststr,
 
     av_freep(&auth_b64);
     if (http_write(h, s->buffer, strlen(s->buffer)) < 0)
-        return AVERROR_IO;
+        return AVERROR(EIO);
 
     /* init input buffer */
     s->buf_ptr = s->buffer;
@@ -246,7 +247,6 @@ static int http_connect(URLContext *h, const char *path, const char *hoststr,
     s->off = 0;
     s->filesize = -1;
     if (post) {
-        usleep(1000*1000);
         return 0;
     }
 
@@ -255,7 +255,7 @@ static int http_connect(URLContext *h, const char *path, const char *hoststr,
     for(;;) {
         ch = http_getc(s);
         if (ch < 0)
-            return AVERROR_IO;
+            return AVERROR(EIO);
         if (ch == '\n') {
             /* process line */
             if (q > line && q[-1] == '\r')