Avoid retrying fatal errors
Also clear fatal errors on seek operations PiperOrigin-RevId: 269780886
This commit is contained in:
parent
3b22db33ba
commit
9863cd33fa
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
### dev-v2 (not yet released) ###
|
### dev-v2 (not yet released) ###
|
||||||
|
|
||||||
|
* Fix bug causing the retry of loading tasks that resulted in fatal errors.
|
||||||
* DASH: Support negative @r values in segment timelines
|
* DASH: Support negative @r values in segment timelines
|
||||||
([#1787](https://github.com/google/ExoPlayer/issues/1787)).
|
([#1787](https://github.com/google/ExoPlayer/issues/1787)).
|
||||||
* Add `allowedCapturePolicy` field to `AudioAttributes` wrapper to allow to
|
* Add `allowedCapturePolicy` field to `AudioAttributes` wrapper to allow to
|
||||||
|
@ -337,7 +337,10 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean continueLoading(long playbackPositionUs) {
|
public boolean continueLoading(long playbackPositionUs) {
|
||||||
if (loadingFinished || pendingDeferredRetry || (prepared && enabledTrackCount == 0)) {
|
if (loadingFinished
|
||||||
|
|| loader.hasFatalError()
|
||||||
|
|| pendingDeferredRetry
|
||||||
|
|| (prepared && enabledTrackCount == 0)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
boolean continuedLoading = loadCondition.open();
|
boolean continuedLoading = loadCondition.open();
|
||||||
@ -422,6 +425,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
|
|||||||
if (loader.isLoading()) {
|
if (loader.isLoading()) {
|
||||||
loader.cancelLoading();
|
loader.cancelLoading();
|
||||||
} else {
|
} else {
|
||||||
|
loader.clearFatalError();
|
||||||
for (SampleQueue sampleQueue : sampleQueues) {
|
for (SampleQueue sampleQueue : sampleQueues) {
|
||||||
sampleQueue.reset();
|
sampleQueue.reset();
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean continueLoading(long positionUs) {
|
public boolean continueLoading(long positionUs) {
|
||||||
if (loadingFinished || loader.isLoading()) {
|
if (loadingFinished || loader.isLoading() || loader.hasFatalError()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
DataSource dataSource = dataSourceFactory.createDataSource();
|
DataSource dataSource = dataSourceFactory.createDataSource();
|
||||||
|
@ -306,6 +306,7 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S
|
|||||||
if (loader.isLoading()) {
|
if (loader.isLoading()) {
|
||||||
loader.cancelLoading();
|
loader.cancelLoading();
|
||||||
} else {
|
} else {
|
||||||
|
loader.clearFatalError();
|
||||||
primarySampleQueue.reset();
|
primarySampleQueue.reset();
|
||||||
for (SampleQueue embeddedSampleQueue : embeddedSampleQueues) {
|
for (SampleQueue embeddedSampleQueue : embeddedSampleQueues) {
|
||||||
embeddedSampleQueue.reset();
|
embeddedSampleQueue.reset();
|
||||||
@ -520,7 +521,7 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean continueLoading(long positionUs) {
|
public boolean continueLoading(long positionUs) {
|
||||||
if (loadingFinished || loader.isLoading()) {
|
if (loadingFinished || loader.isLoading() || loader.hasFatalError()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -587,7 +588,7 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reevaluateBuffer(long positionUs) {
|
public void reevaluateBuffer(long positionUs) {
|
||||||
if (loader.isLoading() || isPendingReset()) {
|
if (loader.isLoading() || loader.hasFatalError() || isPendingReset()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,6 +213,19 @@ public final class Loader implements LoaderErrorThrower {
|
|||||||
retryDelayMillis);
|
retryDelayMillis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the last call to {@link #startLoading} resulted in a fatal error. Calling {@link
|
||||||
|
* #maybeThrowError()} will throw the fatal error.
|
||||||
|
*/
|
||||||
|
public boolean hasFatalError() {
|
||||||
|
return fatalError != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Clears any stored fatal error. */
|
||||||
|
public void clearFatalError() {
|
||||||
|
fatalError = null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts loading a {@link Loadable}.
|
* Starts loading a {@link Loadable}.
|
||||||
*
|
*
|
||||||
|
@ -1057,6 +1057,9 @@ public final class DashMediaSource extends BaseMediaSource {
|
|||||||
|
|
||||||
private void startLoadingManifest() {
|
private void startLoadingManifest() {
|
||||||
handler.removeCallbacks(refreshManifestRunnable);
|
handler.removeCallbacks(refreshManifestRunnable);
|
||||||
|
if (loader.hasFatalError()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (loader.isLoading()) {
|
if (loader.isLoading()) {
|
||||||
manifestLoadPending = true;
|
manifestLoadPending = true;
|
||||||
return;
|
return;
|
||||||
|
@ -443,6 +443,7 @@ import java.util.Set;
|
|||||||
if (loader.isLoading()) {
|
if (loader.isLoading()) {
|
||||||
loader.cancelLoading();
|
loader.cancelLoading();
|
||||||
} else {
|
} else {
|
||||||
|
loader.clearFatalError();
|
||||||
resetSampleQueues();
|
resetSampleQueues();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -595,7 +596,7 @@ import java.util.Set;
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean continueLoading(long positionUs) {
|
public boolean continueLoading(long positionUs) {
|
||||||
if (loadingFinished || loader.isLoading()) {
|
if (loadingFinished || loader.isLoading() || loader.hasFatalError()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -491,8 +491,8 @@ public final class DefaultHlsPlaylistTracker
|
|||||||
|
|
||||||
public void loadPlaylist() {
|
public void loadPlaylist() {
|
||||||
blacklistUntilMs = 0;
|
blacklistUntilMs = 0;
|
||||||
if (loadPending || mediaPlaylistLoader.isLoading()) {
|
if (loadPending || mediaPlaylistLoader.isLoading() || mediaPlaylistLoader.hasFatalError()) {
|
||||||
// Load already pending or in progress. Do nothing.
|
// Load already pending, in progress, or a fatal error has been encountered. Do nothing.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
long currentTimeMs = SystemClock.elapsedRealtime();
|
long currentTimeMs = SystemClock.elapsedRealtime();
|
||||||
|
@ -746,6 +746,9 @@ public final class SsMediaSource extends BaseMediaSource
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void startLoadingManifest() {
|
private void startLoadingManifest() {
|
||||||
|
if (manifestLoader.hasFatalError()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
ParsingLoadable<SsManifest> loadable = new ParsingLoadable<>(manifestDataSource,
|
ParsingLoadable<SsManifest> loadable = new ParsingLoadable<>(manifestDataSource,
|
||||||
manifestUri, C.DATA_TYPE_MANIFEST, manifestParser);
|
manifestUri, C.DATA_TYPE_MANIFEST, manifestParser);
|
||||||
long elapsedRealtimeMs =
|
long elapsedRealtimeMs =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user