mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Enable nullness checking for DefaultMediaClock
PiperOrigin-RevId: 322542289
This commit is contained in:
parent
0efec5f6c1
commit
6e751c35c7
1 changed files with 7 additions and 1 deletions
|
|
@ -16,6 +16,7 @@
|
||||||
package com.google.android.exoplayer2;
|
package com.google.android.exoplayer2;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.Clock;
|
import com.google.android.exoplayer2.util.Clock;
|
||||||
import com.google.android.exoplayer2.util.MediaClock;
|
import com.google.android.exoplayer2.util.MediaClock;
|
||||||
import com.google.android.exoplayer2.util.StandaloneMediaClock;
|
import com.google.android.exoplayer2.util.StandaloneMediaClock;
|
||||||
|
|
@ -133,7 +134,9 @@ import com.google.android.exoplayer2.util.StandaloneMediaClock;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getPositionUs() {
|
public long getPositionUs() {
|
||||||
return isUsingStandaloneClock ? standaloneClock.getPositionUs() : rendererClock.getPositionUs();
|
return isUsingStandaloneClock
|
||||||
|
? standaloneClock.getPositionUs()
|
||||||
|
: Assertions.checkNotNull(rendererClock).getPositionUs();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -160,6 +163,9 @@ import com.google.android.exoplayer2.util.StandaloneMediaClock;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// We are either already using the renderer clock or switching from the standalone to the
|
||||||
|
// renderer clock, so it must be non-null.
|
||||||
|
MediaClock rendererClock = Assertions.checkNotNull(this.rendererClock);
|
||||||
long rendererClockPositionUs = rendererClock.getPositionUs();
|
long rendererClockPositionUs = rendererClock.getPositionUs();
|
||||||
if (isUsingStandaloneClock) {
|
if (isUsingStandaloneClock) {
|
||||||
// Ensure enabling the renderer clock doesn't jump backwards in time.
|
// Ensure enabling the renderer clock doesn't jump backwards in time.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue