OSDN Git Service

avformat/rtmphttp: Partial fix for the ticket #3127 (second try)
authorByte <hzdbyte@gmail.com>
Fri, 15 Nov 2013 17:33:43 +0000 (00:33 +0700)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 16 Nov 2013 01:45:58 +0000 (02:45 +0100)
Reviewed-by: Lukasz M <lukasz.m.luki@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/rtmphttp.c

index 49909ee..8080b29 100644 (file)
@@ -113,7 +113,7 @@ static int rtmp_http_read(URLContext *h, uint8_t *buf, int size)
         if (ret < 0 && ret != AVERROR_EOF)
             return ret;
 
-        if (ret == AVERROR_EOF) {
+        if (ret == 0 || ret == AVERROR_EOF) {
             if (rt->finishing) {
                 /* Do not send new requests when the client wants to
                  * close the connection. */
@@ -227,7 +227,7 @@ static int rtmp_http_open(URLContext *h, const char *uri, int flags)
     /* read the server reply which contains a unique ID */
     for (;;) {
         ret = ffurl_read(rt->stream, rt->client_id + off, sizeof(rt->client_id) - off);
-        if (ret == AVERROR_EOF)
+        if (ret == 0 || ret == AVERROR_EOF)
             break;
         if (ret < 0)
             goto fail;