Commit 55862a77 by Oliver Woodman

Remove dead code

parent 51a8635b
...@@ -83,7 +83,6 @@ public class ChunkSampleSource implements SampleSource, SampleSourceReader, Load ...@@ -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 ...@@ -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 ...@@ -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;
......
...@@ -91,7 +91,6 @@ public class ExtractorSampleSource implements SampleSource, SampleSourceReader, ...@@ -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, ...@@ -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, ...@@ -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, ...@@ -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() {
......
...@@ -86,7 +86,6 @@ public class HlsSampleSource implements SampleSource, SampleSourceReader, Loader ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment