Remove ExoPlayer uses of ERROR_CODE_DRM_UNSPECIFIED

PiperOrigin-RevId: 385783671
This commit is contained in:
aquilescanta 2021-07-20 15:40:48 +01:00 committed by Ian Baker
parent d47d1ebf19
commit 14e582b7e5
3 changed files with 6 additions and 7 deletions

View file

@ -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;
} }
} }

View file

@ -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;

View file

@ -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();