Remove dead code

This commit is contained in:
Oliver Woodman 2015-06-18 18:53:22 +01:00
parent 51a8635ba2
commit 55862a77b1
3 changed files with 4 additions and 29 deletions

View file

@ -83,7 +83,6 @@ public class ChunkSampleSource implements SampleSource, SampleSourceReader, Load
private Loader loader;
private boolean loadingFinished;
private IOException currentLoadableException;
private boolean currentLoadableExceptionFatal;
private int currentLoadableExceptionCount;
private long currentLoadableExceptionTimestamp;
private long currentLoadStartTimeMs;
@ -294,8 +293,7 @@ public class ChunkSampleSource implements SampleSource, SampleSourceReader, Load
}
private void maybeThrowLoadableException() throws IOException {
if (currentLoadableException != null && (currentLoadableExceptionFatal
|| currentLoadableExceptionCount > minLoadableRetryCount)) {
if (currentLoadableException != null && currentLoadableExceptionCount > minLoadableRetryCount) {
throw currentLoadableException;
}
if (sampleQueue.isEmpty() && currentLoadableHolder.chunk == null) {
@ -406,16 +404,9 @@ public class ChunkSampleSource implements SampleSource, SampleSourceReader, Load
private void clearCurrentLoadableException() {
currentLoadableException = null;
currentLoadableExceptionCount = 0;
currentLoadableExceptionFatal = false;
}
private void updateLoadControl() {
if (currentLoadableExceptionFatal) {
// We've failed, but we still need to update the control with our current state.
loadControl.update(this, downstreamPositionUs, -1, false, true);
return;
}
long now = SystemClock.elapsedRealtime();
long nextLoadPositionUs = getNextLoadPositionUs();
boolean isBackedOff = currentLoadableException != null;

View file

@ -91,7 +91,6 @@ public class ExtractorSampleSource implements SampleSource, SampleSourceReader,
private Loader loader;
private ExtractingLoadable loadable;
private IOException currentLoadableException;
private boolean currentLoadableExceptionFatal;
// TODO: Set this back to 0 in the correct place (some place indicative of making progress).
private int currentLoadableExceptionCount;
private long currentLoadableExceptionTimestamp;
@ -404,7 +403,7 @@ public class ExtractorSampleSource implements SampleSource, SampleSourceReader,
}
private void maybeStartLoading() {
if (currentLoadableExceptionFatal || loadingFinished || loader.isLoading()) {
if (loadingFinished || loader.isLoading()) {
return;
}
@ -470,9 +469,6 @@ public class ExtractorSampleSource implements SampleSource, SampleSourceReader,
if (currentLoadableException == null) {
return;
}
if (currentLoadableExceptionFatal) {
throw currentLoadableException;
}
int minLoadableRetryCountForMedia;
if (minLoadableRetryCount != MIN_RETRY_COUNT_DEFAULT_FOR_MEDIA) {
minLoadableRetryCountForMedia = minLoadableRetryCount;
@ -528,7 +524,6 @@ public class ExtractorSampleSource implements SampleSource, SampleSourceReader,
loadable = null;
currentLoadableException = null;
currentLoadableExceptionCount = 0;
currentLoadableExceptionFatal = false;
}
private boolean isPendingReset() {

View file

@ -86,7 +86,6 @@ public class HlsSampleSource implements SampleSource, SampleSourceReader, Loader
private Loader loader;
private IOException currentLoadableException;
private boolean currentLoadableExceptionFatal;
private int currentLoadableExceptionCount;
private long currentLoadableExceptionTimestamp;
private long currentLoadStartTimeMs;
@ -362,9 +361,7 @@ public class HlsSampleSource implements SampleSource, SampleSourceReader, Loader
notifyLoadCompleted(currentLoadable.bytesLoaded(), currentLoadable.type,
currentLoadable.trigger, currentLoadable.format, -1, -1, now, loadDurationMs);
}
if (!currentLoadableExceptionFatal) {
clearCurrentLoadable();
}
clearCurrentLoadable();
if (enabledTrackCount > 0 || !prepared) {
maybeStartLoading();
}
@ -439,8 +436,7 @@ public class HlsSampleSource implements SampleSource, SampleSourceReader, Loader
}
private void maybeThrowLoadableException() throws IOException {
if (currentLoadableException != null && (currentLoadableExceptionFatal
|| currentLoadableExceptionCount > minLoadableRetryCount)) {
if (currentLoadableException != null && currentLoadableExceptionCount > minLoadableRetryCount) {
throw currentLoadableException;
}
}
@ -469,16 +465,9 @@ public class HlsSampleSource implements SampleSource, SampleSourceReader, Loader
currentLoadable = null;
currentLoadableException = null;
currentLoadableExceptionCount = 0;
currentLoadableExceptionFatal = false;
}
private void maybeStartLoading() {
if (currentLoadableExceptionFatal) {
// We've failed, but we still need to update the control with our current state.
loadControl.update(this, downstreamPositionUs, -1, false, true);
return;
}
long now = SystemClock.elapsedRealtime();
long nextLoadPositionUs = getNextLoadPositionUs();
boolean isBackedOff = currentLoadableException != null;