changeset 30376:3365a4658320

Fix ftp support to properly support large files > 2GB. Patch by Yuriy Kaminskiy [yumkam mail ru]
author reimar
date Sun, 24 Jan 2010 10:13:33 +0000
parents 4964a530de54
children 2eea1f09e2c5
files stream/stream_ftp.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream_ftp.c	Sun Jan 24 03:21:18 2010 +0000
+++ b/stream/stream_ftp.c	Sun Jan 24 10:13:33 2010 +0000
@@ -244,7 +244,7 @@
   return fd;
 }
 
-static int FtpOpenData(stream_t* s,size_t newpos) {
+static int FtpOpenData(stream_t* s,off_t newpos) {
   struct stream_priv_s* p = s->priv;
   int resp;
   char str[256],rsp_txt[256];
@@ -369,7 +369,8 @@
 
 
 static int open_f(stream_t *stream,int mode, void* opts, int* file_format) {
-  int len = 0,resp;
+  int resp;
+  int64_t len = 0;
   struct stream_priv_s* p = (struct stream_priv_s*)opts;
   char str[256],rsp_txt[256];
 
@@ -438,7 +439,7 @@
     mp_msg(MSGT_OPEN,MSGL_WARN, "[ftp] command '%s' failed: %s\n",str,rsp_txt);
   } else {
     int dummy;
-    sscanf(rsp_txt,"%d %d",&dummy,&len);
+    sscanf(rsp_txt,"%d %"SCNd64,&dummy,&len);
   }
 
   if(len > 0) {