avformat/ftp: return AVERROR_EOF for EOF

Without this FTP just hangs on eof...

Signed-off-by: Marton Balint <cus@passwd.hu>
pull/299/head
Marton Balint 6 years ago
parent 295fd12d17
commit 6a034adf75
  1. 4
      libavformat/ftp.c

@ -781,13 +781,13 @@ static int ftp_read(URLContext *h, unsigned char *buf, int size)
if (s->state == DISCONNECTED) { if (s->state == DISCONNECTED) {
/* optimization */ /* optimization */
if (s->position >= s->filesize) if (s->position >= s->filesize)
return 0; return AVERROR_EOF;
if ((err = ftp_connect_data_connection(h)) < 0) if ((err = ftp_connect_data_connection(h)) < 0)
return err; return err;
} }
if (s->state == READY) { if (s->state == READY) {
if (s->position >= s->filesize) if (s->position >= s->filesize)
return 0; return AVERROR_EOF;
if ((err = ftp_retrieve(s)) < 0) if ((err = ftp_retrieve(s)) < 0)
return err; return err;
} }

Loading…
Cancel
Save