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 Loader loader;
private boolean loadingFinished; private boolean loadingFinished;
private IOException currentLoadableException; private IOException currentLoadableException;
private boolean currentLoadableExceptionFatal;
private int currentLoadableExceptionCount; private int currentLoadableExceptionCount;
private long currentLoadableExceptionTimestamp; private long currentLoadableExceptionTimestamp;
private long currentLoadStartTimeMs; private long currentLoadStartTimeMs;
@ -294,8 +293,7 @@ public class ChunkSampleSource implements SampleSource, SampleSourceReader, Load
} }
private void maybeThrowLoadableException() throws IOException { private void maybeThrowLoadableException() throws IOException {
if (currentLoadableException != null && (currentLoadableExceptionFatal if (currentLoadableException != null && currentLoadableExceptionCount > minLoadableRetryCount) {
|| currentLoadableExceptionCount > minLoadableRetryCount)) {
throw currentLoadableException; throw currentLoadableException;
} }
if (sampleQueue.isEmpty() && currentLoadableHolder.chunk == null) { if (sampleQueue.isEmpty() && currentLoadableHolder.chunk == null) {
@ -406,16 +404,9 @@ public class ChunkSampleSource implements SampleSource, SampleSourceReader, Load
private void clearCurrentLoadableException() { private void clearCurrentLoadableException() {
currentLoadableException = null; currentLoadableException = null;
currentLoadableExceptionCount = 0; currentLoadableExceptionCount = 0;
currentLoadableExceptionFatal = false;
} }
private void updateLoadControl() { 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 now = SystemClock.elapsedRealtime();
long nextLoadPositionUs = getNextLoadPositionUs(); long nextLoadPositionUs = getNextLoadPositionUs();
boolean isBackedOff = currentLoadableException != null; boolean isBackedOff = currentLoadableException != null;

View file

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

View file

@ -86,7 +86,6 @@ public class HlsSampleSource implements SampleSource, SampleSourceReader, Loader
private Loader loader; private Loader loader;
private IOException currentLoadableException; private IOException currentLoadableException;
private boolean currentLoadableExceptionFatal;
private int currentLoadableExceptionCount; private int currentLoadableExceptionCount;
private long currentLoadableExceptionTimestamp; private long currentLoadableExceptionTimestamp;
private long currentLoadStartTimeMs; private long currentLoadStartTimeMs;
@ -362,9 +361,7 @@ public class HlsSampleSource implements SampleSource, SampleSourceReader, Loader
notifyLoadCompleted(currentLoadable.bytesLoaded(), currentLoadable.type, notifyLoadCompleted(currentLoadable.bytesLoaded(), currentLoadable.type,
currentLoadable.trigger, currentLoadable.format, -1, -1, now, loadDurationMs); currentLoadable.trigger, currentLoadable.format, -1, -1, now, loadDurationMs);
} }
if (!currentLoadableExceptionFatal) { clearCurrentLoadable();
clearCurrentLoadable();
}
if (enabledTrackCount > 0 || !prepared) { if (enabledTrackCount > 0 || !prepared) {
maybeStartLoading(); maybeStartLoading();
} }
@ -439,8 +436,7 @@ public class HlsSampleSource implements SampleSource, SampleSourceReader, Loader
} }
private void maybeThrowLoadableException() throws IOException { private void maybeThrowLoadableException() throws IOException {
if (currentLoadableException != null && (currentLoadableExceptionFatal if (currentLoadableException != null && currentLoadableExceptionCount > minLoadableRetryCount) {
|| currentLoadableExceptionCount > minLoadableRetryCount)) {
throw currentLoadableException; throw currentLoadableException;
} }
} }
@ -469,16 +465,9 @@ public class HlsSampleSource implements SampleSource, SampleSourceReader, Loader
currentLoadable = null; currentLoadable = null;
currentLoadableException = null; currentLoadableException = null;
currentLoadableExceptionCount = 0; currentLoadableExceptionCount = 0;
currentLoadableExceptionFatal = false;
} }
private void maybeStartLoading() { 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 now = SystemClock.elapsedRealtime();
long nextLoadPositionUs = getNextLoadPositionUs(); long nextLoadPositionUs = getNextLoadPositionUs();
boolean isBackedOff = currentLoadableException != null; boolean isBackedOff = currentLoadableException != null;