MP4 muxer +misc modifications
* allow retry downloads with "post-processing failed" error in the new muxer * MPEG-4 muxer ¡¡ no DASH output!! * keep the progress if download fails * remove TODO in SecondaryStreamHelper.java * misc clean-up * delete TestAlgo.java * delete ExtSDDownloadFailedActivity.java and remove it from AndroidManifest.xml * use hardcored version for changing icon colors
This commit is contained in:
parent
684cb81974
commit
f2285c0b19
15 changed files with 357 additions and 260 deletions
|
|
@ -141,15 +141,18 @@ public class DownloadManager {
|
|||
File dl = mis.getDownloadedFile();
|
||||
boolean exists = dl.exists();
|
||||
|
||||
if (mis.postprocessingRunning && mis.postprocessingThis) {
|
||||
// Incomplete post-processing results in a corrupted download file
|
||||
// because the selected algorithm works on the same file to save space.
|
||||
if (!dl.delete()) {
|
||||
Log.w(TAG, "Unable to delete incomplete download file: " + sub.getPath());
|
||||
if (mis.isPsRunning()) {
|
||||
if (mis.postprocessingThis) {
|
||||
// Incomplete post-processing results in a corrupted download file
|
||||
// because the selected algorithm works on the same file to save space.
|
||||
if (exists && dl.isFile() && !dl.delete())
|
||||
Log.w(TAG, "Unable to delete incomplete download file: " + sub.getPath());
|
||||
|
||||
exists = true;
|
||||
}
|
||||
exists = true;
|
||||
mis.postprocessingRunning = false;
|
||||
mis.errCode = DownloadMission.ERROR_POSTPROCESSING_FAILED;
|
||||
|
||||
mis.postprocessingState = 0;
|
||||
mis.errCode = DownloadMission.ERROR_POSTPROCESSING;
|
||||
mis.errObject = new RuntimeException("stopped unexpectedly");
|
||||
} else if (exists && !dl.isFile()) {
|
||||
// probably a folder, this should never happens
|
||||
|
|
@ -332,7 +335,7 @@ public class DownloadManager {
|
|||
int count = 0;
|
||||
synchronized (this) {
|
||||
for (DownloadMission mission : mMissionsPending) {
|
||||
if (mission.running && mission.errCode != DownloadMission.ERROR_POSTPROCESSING_FAILED && !mission.isFinished())
|
||||
if (mission.running && !mission.isFinished() && !mission.isPsFailed())
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
|
@ -471,7 +474,7 @@ public class DownloadManager {
|
|||
boolean flag = false;
|
||||
synchronized (this) {
|
||||
for (DownloadMission mission : mMissionsPending) {
|
||||
if (mission.running && mission.isFinished() && !mission.postprocessingRunning) {
|
||||
if (mission.running && !mission.isFinished() && !mission.isPsRunning()) {
|
||||
flag = true;
|
||||
mission.pause();
|
||||
}
|
||||
|
|
@ -528,6 +531,8 @@ public class DownloadManager {
|
|||
ArrayList<Object> current;
|
||||
ArrayList<Mission> hidden;
|
||||
|
||||
boolean hasFinished = false;
|
||||
|
||||
private MissionIterator() {
|
||||
hidden = new ArrayList<>(2);
|
||||
current = null;
|
||||
|
|
@ -563,6 +568,7 @@ public class DownloadManager {
|
|||
list.addAll(finished);
|
||||
}
|
||||
|
||||
hasFinished = finished.size() > 0;
|
||||
|
||||
return list;
|
||||
}
|
||||
|
|
@ -637,6 +643,10 @@ public class DownloadManager {
|
|||
hidden.remove(mission);
|
||||
}
|
||||
|
||||
public boolean hasFinishedMissions() {
|
||||
return hasFinished;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getOldListSize() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue