Commit 14e582b7 by aquilescanta Committed by Ian Baker

Remove ExoPlayer uses of ERROR_CODE_DRM_UNSPECIFIED

PiperOrigin-RevId: 385783671
parent d47d1ebf
...@@ -564,7 +564,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -564,7 +564,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
// better diagnosis tools were provided, we treat this as a system error. // better diagnosis tools were provided, we treat this as a system error.
return PlaybackException.ERROR_CODE_DRM_SYSTEM_ERROR; return PlaybackException.ERROR_CODE_DRM_SYSTEM_ERROR;
} else { } else {
return PlaybackException.ERROR_CODE_DRM_UNSPECIFIED; // The error happened during the license request.
return PlaybackException.ERROR_CODE_DRM_LICENSE_ACQUISITION_FAILED;
} }
} }
......
...@@ -570,12 +570,10 @@ public abstract class MediaCodecRenderer extends BaseRenderer { ...@@ -570,12 +570,10 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
if (FrameworkMediaCrypto.WORKAROUND_DEVICE_NEEDS_KEYS_TO_CONFIGURE_CODEC) { if (FrameworkMediaCrypto.WORKAROUND_DEVICE_NEEDS_KEYS_TO_CONFIGURE_CODEC) {
@DrmSession.State int drmSessionState = codecDrmSession.getState(); @DrmSession.State int drmSessionState = codecDrmSession.getState();
if (drmSessionState == DrmSession.STATE_ERROR) { if (drmSessionState == DrmSession.STATE_ERROR) {
// TODO(internal b/184262323): Assign a proper error code, once we attach that information DrmSessionException drmSessionException =
// to DrmSessionException. Assertions.checkNotNull(codecDrmSession.getError());
throw createRendererException( throw createRendererException(
codecDrmSession.getError(), drmSessionException, inputFormat, drmSessionException.errorCode);
inputFormat,
PlaybackException.ERROR_CODE_DRM_UNSPECIFIED);
} else if (drmSessionState != DrmSession.STATE_OPENED_WITH_KEYS) { } else if (drmSessionState != DrmSession.STATE_OPENED_WITH_KEYS) {
// Wait for keys. // Wait for keys.
return; return;
......
...@@ -558,7 +558,7 @@ public final class SampleQueueTest { ...@@ -558,7 +558,7 @@ public final class SampleQueueTest {
when(mockDrmSession.getError()) when(mockDrmSession.getError())
.thenReturn( .thenReturn(
new DrmSession.DrmSessionException( new DrmSession.DrmSessionException(
new Exception(), PlaybackException.ERROR_CODE_DRM_UNSPECIFIED)); new Exception(), PlaybackException.ERROR_CODE_DRM_SYSTEM_ERROR));
assertReadNothing(/* formatRequired= */ false); assertReadNothing(/* formatRequired= */ false);
try { try {
sampleQueue.maybeThrowError(); sampleQueue.maybeThrowError();
......
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