mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-26 07:38:09 +00:00
Change first call of OnProgress for H264 download
This commit is contained in:
parent
171ada8a32
commit
9c5174e0bb
1 changed files with 2 additions and 3 deletions
|
|
@ -90,7 +90,7 @@ public class OpenH264DownloadHelper {
|
|||
* @param object
|
||||
* @return index of object in UserData list
|
||||
*/
|
||||
public int setUserDate(Object object) {
|
||||
public int setUserData(Object object) {
|
||||
this.userData.add(object);
|
||||
return this.userData.indexOf(object);
|
||||
}
|
||||
|
|
@ -186,16 +186,15 @@ public class OpenH264DownloadHelper {
|
|||
URL url = new URL(urlDownload);
|
||||
HttpURLConnection urlConnection = (HttpURLConnection)url.openConnection();
|
||||
urlConnection.connect();
|
||||
openH264DownloadHelperListener.OnProgress(0,10);
|
||||
|
||||
InputStream inputStream = urlConnection.getInputStream();
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(fileDirection+"/"+nameFileDownload);
|
||||
int totalSize = urlConnection.getContentLength();
|
||||
openH264DownloadHelperListener.OnProgress(0,totalSize);
|
||||
|
||||
byte[] buffer = new byte[4096];
|
||||
int bufferLength;
|
||||
int total = 0;
|
||||
openH264DownloadHelperListener.OnProgress(total, totalSize);
|
||||
while((bufferLength = inputStream.read(buffer))>0 ){
|
||||
total += bufferLength;
|
||||
fileOutputStream.write(buffer, 0, bufferLength);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue