From 470ec9e5d18a319a72e831b30967ad12dbb33fc3 Mon Sep 17 00:00:00 2001 From: andrewlewis Date: Wed, 4 Mar 2020 11:44:32 +0000 Subject: [PATCH] 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 --- .../com/google/android/exoplayer2/ext/ima/ImaAdsLoader.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoader.java b/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoader.java index 43c897057a..02a66c3736 100644 --- a/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoader.java +++ b/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoader.java @@ -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);