avformat/ftp: return AVERROR_EOF for EOF

Without this FTP just hangs on eof...

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit 6a034adf7516fde8733064ed7ba5c77554298047)
This commit is contained in:
Marton Balint 2018-11-01 20:48:55 +01:00
parent 00e7e4b188
commit ebc01c8f6d

View 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;
}