Init the ads manager for placeholder timelines

It looks like loading ad cue points would cause a source info refresh
causing the content media period load to be canceled, meaning we would
never get a non-placeholder timeline.

This changes ensures that the ads manager will still be initialized,
avoiding playback getting stuck when playing a ProgressiveMediaPeriod
with a preroll ad.

PiperOrigin-RevId: 298814758
This commit is contained in:
andrewlewis 2020-03-04 11:44:32 +00:00 committed by Oliver Woodman
parent d8ea1f60af
commit 470ec9e5d1

View file

@ -967,10 +967,6 @@ public final class ImaAdsLoader
return;
}
Assertions.checkArgument(timeline.getPeriodCount() == 1);
if (timeline.getWindow(/* windowIndex= */ 0, window).isPlaceholder) {
// This is just a placeholder. Wait until we get the fully prepared timeline.
return;
}
this.timeline = timeline;
long contentDurationUs = timeline.getPeriod(/* periodIndex= */ 0, period).durationUs;
contentDurationMs = C.usToMs(contentDurationUs);