avformat/ftp: return AVERROR_EOF for EOF

Without this FTP just hangs on eof...

Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
Marton Balint 2018-11-01 20:48:55 +01:00
parent 295fd12d17
commit 6a034adf75

View File

@ -781,13 +781,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;
}