Skip to content

Commit

Permalink
We're not playing an ad if the timeline is empty.
Browse files Browse the repository at this point in the history
Issue: #3334

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172447125
  • Loading branch information
ojw28 committed Oct 17, 2017
1 parent f6821c6 commit 2c10e6f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -386,17 +386,17 @@ public boolean isCurrentWindowSeekable() {

@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
Expand Down

0 comments on commit 2c10e6f

Please sign in to comment.