浏览代码

1.上传速度优化

huangxiaodong 1 年之前
父节点
当前提交
c98b892a5a
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      创维盒子/双子星云手机/CloudPlayer/PlayerViewController+otherDelegate.mm

+ 3 - 2
创维盒子/双子星云手机/CloudPlayer/PlayerViewController+otherDelegate.mm

@@ -325,6 +325,7 @@
     NSFileHandle *fileHandle = [NSFileHandle fileHandleForReadingAtPath:filePath]; // 创建文件句柄
       
     // 设置分段读取的大小,这里以每次读取1KB为例
+    //const NSUInteger chunkSize = 50 * 1024 *1024;
     const NSUInteger chunkSize = 50 * 1024 *1024;
     NSMutableData *data = [NSMutableData data];
     
@@ -501,8 +502,8 @@
     
     NSUInteger allLength = data.length;
     
-    //NSUInteger subs = 100*1024;//4096;//要切片的大小,我这里设置的是4096字节
-    NSUInteger subs = 31*1024;//4096;//要切片的大小,内存没有暴增
+    NSUInteger subs = 5*1024*1024;//4096;//要切片的大小,我这里设置的是4096字节
+    //NSUInteger subs = 31*1024;//4096;//要切片的大小,内存没有暴增
     
     self.cutFileEachPieceSzie = subs;