From 5df2f142b4436c22856dfd4e5f1bc7b83fc971dd Mon Sep 17 00:00:00 2001 From: aquilescanta Date: Tue, 17 Sep 2019 14:17:06 +0100 Subject: [PATCH] Don't retry fatal errors in DefaultDrmSession Issue:#6334 PiperOrigin-RevId: 269553308 --- .../google/android/exoplayer2/drm/DefaultDrmSession.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/drm/DefaultDrmSession.java b/library/core/src/main/java/com/google/android/exoplayer2/drm/DefaultDrmSession.java index e6364dbedbc..14e813ceb89 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/drm/DefaultDrmSession.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/drm/DefaultDrmSession.java @@ -566,8 +566,6 @@ private boolean maybeRetryRequest(Message originalMsg, Exception e) { > loadErrorHandlingPolicy.getMinimumLoadableRetryCount(C.DATA_TYPE_DRM)) { return false; } - Message retryMsg = Message.obtain(originalMsg); - IOException ioException = e instanceof IOException ? (IOException) e : new UnexpectedDrmSessionException(e); long retryDelayMs = @@ -576,7 +574,11 @@ private boolean maybeRetryRequest(Message originalMsg, Exception e) { /* loadDurationMs= */ SystemClock.elapsedRealtime() - requestTask.startTimeMs, ioException, requestTask.errorCount); - sendMessageDelayed(retryMsg, retryDelayMs); + if (retryDelayMs == C.TIME_UNSET) { + // The error is fatal. + return false; + } + sendMessageDelayed(Message.obtain(originalMsg), retryDelayMs); return true; } }