diff mbox

[FFmpeg-devel,1/2] avformat/ftp: return AVERROR_EOF for EOF

Message ID 20181101200641.20816-1-cus@passwd.hu
State Accepted
Commit 6a034adf7516fde8733064ed7ba5c77554298047
Headers show

Commit Message

Marton Balint Nov. 1, 2018, 8:06 p.m. UTC
Without this FTP just hangs on eof...

Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavformat/ftp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Nicolas George Nov. 1, 2018, 8:07 p.m. UTC | #1
Marton Balint (2018-11-01):
> Without this FTP just hangs on eof...
> 
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
>  libavformat/ftp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

LGTM.

Regards,
Marton Balint Nov. 1, 2018, 10:20 p.m. UTC | #2
On Thu, 1 Nov 2018, Nicolas George wrote:

> Marton Balint (2018-11-01):
>> Without this FTP just hangs on eof...
>> 
>> Signed-off-by: Marton Balint <cus@passwd.hu>
>> ---
>>  libavformat/ftp.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> LGTM.

Thanks, pushed and backported to 4.0.

Regards,
Marton
diff mbox

Patch

diff --git a/libavformat/ftp.c b/libavformat/ftp.c
index 676f1c6b4c..5063b7c204 100644
--- a/libavformat/ftp.c
+++ b/libavformat/ftp.c
@@ -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;
     }