Commit 2c10e6f1 by olly Committed by Oliver Woodman

We're not playing an ad if the timeline is empty.

Issue: #3334

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172447125
parent f6821c6d
......@@ -386,17 +386,17 @@ import java.util.concurrent.CopyOnWriteArraySet;
@Override
public boolean isPlayingAd() {
return pendingSeekAcks == 0 && playbackInfo.periodId.isAd();
return !timeline.isEmpty() && pendingSeekAcks == 0 && playbackInfo.periodId.isAd();
}
@Override
public int getCurrentAdGroupIndex() {
return pendingSeekAcks == 0 ? playbackInfo.periodId.adGroupIndex : C.INDEX_UNSET;
return isPlayingAd() ? playbackInfo.periodId.adGroupIndex : C.INDEX_UNSET;
}
@Override
public int getCurrentAdIndexInAdGroup() {
return pendingSeekAcks == 0 ? playbackInfo.periodId.adIndexInAdGroup : C.INDEX_UNSET;
return isPlayingAd() ? playbackInfo.periodId.adIndexInAdGroup : C.INDEX_UNSET;
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment