1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 16:40:32 +00:00
* rebase fixup, add null check
* better ETA string
* drop connection read timeout, for HSDPA networks
* bump NPE version
This commit is contained in:
kapodamy 2019-11-26 13:41:16 -03:00
parent 0033843bc2
commit 84ec320df4
4 changed files with 5 additions and 6 deletions

View File

@ -62,7 +62,7 @@ dependencies {
exclude module: 'support-annotations'
})
implementation 'com.github.TeamNewPipe:NewPipeExtractor:5c420340ceb39'
implementation 'com.github.TeamNewPipe:NewPipeExtractor:b6d3252'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.23.0'

View File

@ -780,7 +780,7 @@ public class DownloadDialog extends DialogFragment implements RadioGroup.OnCheck
if (selectedStream.getFormat() == MediaFormat.M4A) {
psName = Postprocessing.ALGORITHM_M4A_NO_DASH;
} else if (selectedStream.getFormat() == MediaFormat.OPUS) {
} else if (selectedStream.getFormat() == MediaFormat.WEBMA_OPUS) {
psName = Postprocessing.ALGORITHM_OGG_FROM_WEBM_DEMUXER;
}
break;

View File

@ -228,7 +228,6 @@ public class DownloadMission extends Mission {
// BUG workaround: switching between networks can freeze the download forever
conn.setConnectTimeout(30000);
conn.setReadTimeout(10000);
if (rangeStart >= 0) {
String req = "bytes=" + rangeStart + "-";
@ -316,7 +315,7 @@ public class DownloadMission extends Mission {
public synchronized void notifyError(int code, Exception err) {
Log.e(TAG, "notifyError() code = " + code, err);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (err.getCause() instanceof ErrnoException) {
if (err != null && err.getCause() instanceof ErrnoException) {
int errno = ((ErrnoException) err.getCause()).errno;
if (errno == OsConstants.ENOSPC) {
code = ERROR_INSUFFICIENT_STORAGE;

View File

@ -308,10 +308,10 @@ public class MissionAdapter extends Adapter<ViewHolder> implements Handler.Callb
etaStr = "";
} else {
long eta = (long) Math.ceil((length - done) / averageSpeed);
etaStr = " @ ".concat(Utility.stringifySeconds(eta));
etaStr = Utility.formatBytes((long) done) + "/" + Utility.stringifySeconds(eta) + " ";
}
h.size.setText(sizeStr.concat(speedStr).concat(etaStr));
h.size.setText(sizeStr.concat(etaStr).concat(speedStr));
h.lastTimestamp = now;
h.lastDone = done;