diff --git a/library/core/src/main/java/com/google/android/exoplayer2/drm/DrmSession.java b/library/core/src/main/java/com/google/android/exoplayer2/drm/DrmSession.java index df45323ca3..722ab946f0 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/drm/DrmSession.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/drm/DrmSession.java @@ -31,10 +31,15 @@ public interface DrmSession { /** * Invokes {@code newSession's} {@link #acquireReference()} and {@code previousSession's} {@link - * #releaseReference()} in that order. Does nothing for passed null values. + * #releaseReference()} in that order. Null arguments are ignored. Does nothing if {@code + * previousSession} and {@code newSession} are the same session. */ static void replaceSessionReferences( @Nullable DrmSession previousSession, @Nullable DrmSession newSession) { + if (previousSession == newSession) { + // Do nothing. + return; + } if (newSession != null) { newSession.acquireReference(); }