Commit 1d12d032 by olly Committed by Oliver Woodman

Clarify DRM error deferral comments

- I don't think the session recovering later would work, because
  the codec will be configured not to use it.
- I'm not sure session recovery makes sense in general, and our
  implementations do not do this. Document it as a terminal state
  for now.

PiperOrigin-RevId: 340204194
parent be1fd236
......@@ -603,8 +603,8 @@ public abstract class DecoderAudioRenderer<
if (mediaCrypto == null) {
DrmSessionException drmError = decoderDrmSession.getError();
if (drmError != null) {
// Continue for now. We may be able to avoid failure if the session recovers, or if a new
// input format causes the session to be replaced before it's used.
// Continue for now. We may be able to avoid failure if a new input format causes the
// session to be replaced without it having been used.
} else {
// The drm session isn't open yet.
return;
......
......@@ -66,12 +66,11 @@ public interface DrmSession {
@Retention(RetentionPolicy.SOURCE)
@IntDef({STATE_RELEASED, STATE_ERROR, STATE_OPENING, STATE_OPENED, STATE_OPENED_WITH_KEYS})
@interface State {}
/**
* The session has been released.
*/
/** The session has been released. This is a terminal state. */
int STATE_RELEASED = 0;
/**
* The session has encountered an error. {@link #getError()} can be used to retrieve the cause.
* This is a terminal state.
*/
int STATE_ERROR = 1;
/**
......
......@@ -499,8 +499,8 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
if (sessionMediaCrypto == null) {
@Nullable DrmSessionException drmError = codecDrmSession.getError();
if (drmError != null) {
// Continue for now. We may be able to avoid failure if the session recovers, or if a
// new input format causes the session to be replaced before it's used.
// Continue for now. We may be able to avoid failure if a new input format causes the
// session to be replaced without it having been used.
} else {
// The drm session isn't open yet.
return;
......
......@@ -661,8 +661,8 @@ public abstract class DecoderVideoRenderer extends BaseRenderer {
if (mediaCrypto == null) {
DrmSessionException drmError = decoderDrmSession.getError();
if (drmError != null) {
// Continue for now. We may be able to avoid failure if the session recovers, or if a new
// input format causes the session to be replaced before it's used.
// Continue for now. We may be able to avoid failure if a new input format causes the
// session to be replaced without it having been used.
} else {
// The drm session isn't open yet.
return;
......
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