mirror of
https://github.com/samsonjs/media.git
synced 2026-04-09 11:55:46 +00:00
Remove ExoPlayer uses of ERROR_CODE_DRM_UNSPECIFIED
PiperOrigin-RevId: 385783671
This commit is contained in:
parent
d47d1ebf19
commit
14e582b7e5
3 changed files with 6 additions and 7 deletions
|
|
@ -564,7 +564,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||
// better diagnosis tools were provided, we treat this as a system error.
|
||||
return PlaybackException.ERROR_CODE_DRM_SYSTEM_ERROR;
|
||||
} 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 {
|
|||
if (FrameworkMediaCrypto.WORKAROUND_DEVICE_NEEDS_KEYS_TO_CONFIGURE_CODEC) {
|
||||
@DrmSession.State int drmSessionState = codecDrmSession.getState();
|
||||
if (drmSessionState == DrmSession.STATE_ERROR) {
|
||||
// TODO(internal b/184262323): Assign a proper error code, once we attach that information
|
||||
// to DrmSessionException.
|
||||
DrmSessionException drmSessionException =
|
||||
Assertions.checkNotNull(codecDrmSession.getError());
|
||||
throw createRendererException(
|
||||
codecDrmSession.getError(),
|
||||
inputFormat,
|
||||
PlaybackException.ERROR_CODE_DRM_UNSPECIFIED);
|
||||
drmSessionException, inputFormat, drmSessionException.errorCode);
|
||||
} else if (drmSessionState != DrmSession.STATE_OPENED_WITH_KEYS) {
|
||||
// Wait for keys.
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -558,7 +558,7 @@ public final class SampleQueueTest {
|
|||
when(mockDrmSession.getError())
|
||||
.thenReturn(
|
||||
new DrmSession.DrmSessionException(
|
||||
new Exception(), PlaybackException.ERROR_CODE_DRM_UNSPECIFIED));
|
||||
new Exception(), PlaybackException.ERROR_CODE_DRM_SYSTEM_ERROR));
|
||||
assertReadNothing(/* formatRequired= */ false);
|
||||
try {
|
||||
sampleQueue.maybeThrowError();
|
||||
|
|
|
|||
Loading…
Reference in a new issue