package androidx.media3.exoplayer.source.ads; import androidx.media3.common.AdPlaybackState; import androidx.media3.common.Timeline; import androidx.media3.common.util.Assertions; import androidx.media3.exoplayer.source.ForwardingTimeline; /* loaded from: classes2.dex */ public final class SinglePeriodAdTimeline extends ForwardingTimeline { private final AdPlaybackState adPlaybackState; public SinglePeriodAdTimeline(Timeline timeline, AdPlaybackState adPlaybackState) { super(timeline); Assertions.checkState(timeline.getPeriodCount() == 1); Assertions.checkState(timeline.getWindowCount() == 1); this.adPlaybackState = adPlaybackState; } @Override // androidx.media3.exoplayer.source.ForwardingTimeline, androidx.media3.common.Timeline public Timeline.Period getPeriod(int i, Timeline.Period period, boolean z) { this.timeline.getPeriod(i, period, z); period.set(period.id, period.uid, period.windowIndex, period.durationUs == -9223372036854775807L ? this.adPlaybackState.contentDurationUs : period.durationUs, period.getPositionInWindowUs(), this.adPlaybackState, period.isPlaceholder); return period; } }