avformat/ftp: return AVERROR_EOF for EOF
authorMarton Balint <cus@passwd.hu>
Thu, 1 Nov 2018 19:48:55 +0000 (20:48 +0100)
committerMarton Balint <cus@passwd.hu>
Thu, 1 Nov 2018 22:12:19 +0000 (23:12 +0100)
Without this FTP just hangs on eof...

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit 6a034adf7516fde8733064ed7ba5c77554298047)

libavformat/ftp.c

index 9aa7a45..35bfbd4 100644 (file)
@@ -783,13 +783,13 @@ static int ftp_read(URLContext *h, unsigned char *buf, int size)
     if (s->state == DISCONNECTED) {
         /* optimization */
         if (s->position >= s->filesize)
-            return 0;
+            return AVERROR_EOF;
         if ((err = ftp_connect_data_connection(h)) < 0)
             return err;
     }
     if (s->state == READY) {
         if (s->position >= s->filesize)
-            return 0;
+            return AVERROR_EOF;
         if ((err = ftp_retrieve(s)) < 0)
             return err;
     }