mirror of
https://github.com/androidx/media.git
synced 2025-05-12 18:19:50 +08:00
Add check for retryDelayMs==C.TIME_UNSET in DASH and SS manifest onLoadError.
If the returned retry delay is unset, we should use a DONT_RETRY_FATAL action instead and dispatch the event with the "canceled" flag. PiperOrigin-RevId: 243251554
This commit is contained in:
parent
a588717b46
commit
c1e25f7768
@ -814,7 +814,13 @@ public final class DashMediaSource extends BaseMediaSource {
|
|||||||
long loadDurationMs,
|
long loadDurationMs,
|
||||||
IOException error,
|
IOException error,
|
||||||
int errorCount) {
|
int errorCount) {
|
||||||
boolean isFatal = error instanceof ParserException;
|
long retryDelayMs =
|
||||||
|
loadErrorHandlingPolicy.getRetryDelayMsFor(
|
||||||
|
C.DATA_TYPE_MANIFEST, loadDurationMs, error, errorCount);
|
||||||
|
LoadErrorAction loadErrorAction =
|
||||||
|
retryDelayMs == C.TIME_UNSET
|
||||||
|
? Loader.DONT_RETRY_FATAL
|
||||||
|
: Loader.createRetryAction(/* resetErrorCount= */ false, retryDelayMs);
|
||||||
manifestEventDispatcher.loadError(
|
manifestEventDispatcher.loadError(
|
||||||
loadable.dataSpec,
|
loadable.dataSpec,
|
||||||
loadable.getUri(),
|
loadable.getUri(),
|
||||||
@ -824,13 +830,8 @@ public final class DashMediaSource extends BaseMediaSource {
|
|||||||
loadDurationMs,
|
loadDurationMs,
|
||||||
loadable.bytesLoaded(),
|
loadable.bytesLoaded(),
|
||||||
error,
|
error,
|
||||||
isFatal);
|
!loadErrorAction.isRetry());
|
||||||
return isFatal
|
return loadErrorAction;
|
||||||
? Loader.DONT_RETRY_FATAL
|
|
||||||
: Loader.createRetryAction(
|
|
||||||
/* resetErrorCount= */ false,
|
|
||||||
loadErrorHandlingPolicy.getRetryDelayMsFor(
|
|
||||||
C.DATA_TYPE_MANIFEST, loadDurationMs, error, errorCount));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* package */ void onUtcTimestampLoadCompleted(ParsingLoadable<Long> loadable,
|
/* package */ void onUtcTimestampLoadCompleted(ParsingLoadable<Long> loadable,
|
||||||
|
@ -21,7 +21,6 @@ import android.os.SystemClock;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.ExoPlayerLibraryInfo;
|
import com.google.android.exoplayer2.ExoPlayerLibraryInfo;
|
||||||
import com.google.android.exoplayer2.ParserException;
|
|
||||||
import com.google.android.exoplayer2.Timeline;
|
import com.google.android.exoplayer2.Timeline;
|
||||||
import com.google.android.exoplayer2.offline.FilteringManifestParser;
|
import com.google.android.exoplayer2.offline.FilteringManifestParser;
|
||||||
import com.google.android.exoplayer2.offline.StreamKey;
|
import com.google.android.exoplayer2.offline.StreamKey;
|
||||||
@ -628,7 +627,13 @@ public final class SsMediaSource extends BaseMediaSource
|
|||||||
long loadDurationMs,
|
long loadDurationMs,
|
||||||
IOException error,
|
IOException error,
|
||||||
int errorCount) {
|
int errorCount) {
|
||||||
boolean isFatal = error instanceof ParserException;
|
long retryDelayMs =
|
||||||
|
loadErrorHandlingPolicy.getRetryDelayMsFor(
|
||||||
|
C.DATA_TYPE_MANIFEST, loadDurationMs, error, errorCount);
|
||||||
|
LoadErrorAction loadErrorAction =
|
||||||
|
retryDelayMs == C.TIME_UNSET
|
||||||
|
? Loader.DONT_RETRY_FATAL
|
||||||
|
: Loader.createRetryAction(/* resetErrorCount= */ false, retryDelayMs);
|
||||||
manifestEventDispatcher.loadError(
|
manifestEventDispatcher.loadError(
|
||||||
loadable.dataSpec,
|
loadable.dataSpec,
|
||||||
loadable.getUri(),
|
loadable.getUri(),
|
||||||
@ -638,13 +643,8 @@ public final class SsMediaSource extends BaseMediaSource
|
|||||||
loadDurationMs,
|
loadDurationMs,
|
||||||
loadable.bytesLoaded(),
|
loadable.bytesLoaded(),
|
||||||
error,
|
error,
|
||||||
isFatal);
|
!loadErrorAction.isRetry());
|
||||||
return isFatal
|
return loadErrorAction;
|
||||||
? Loader.DONT_RETRY_FATAL
|
|
||||||
: Loader.createRetryAction(
|
|
||||||
/* resetErrorCount= */ false,
|
|
||||||
loadErrorHandlingPolicy.getRetryDelayMsFor(
|
|
||||||
C.DATA_TYPE_MANIFEST, loadDurationMs, error, errorCount));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Internal methods
|
// Internal methods
|
||||||
|
Loading…
x
Reference in New Issue
Block a user