Fix content position for postroll ads

The position returned by getContentPosition() could be C.TIME_END_OF_SOURCE.
Fix the content position stored in MediaPeriodInfos for postroll ads to be the
duration of the containing period.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162322339
This commit is contained in:
andrewlewis 2017-07-18 00:57:53 -07:00 committed by Oliver Woodman
parent 5be79d4f42
commit c28a2a4100

View file

@ -223,8 +223,9 @@ import com.google.android.exoplayer2.source.MediaSource.MediaPeriodId;
|| !period.isAdAvailable(adGroupCount - 1, 0)) {
return null;
}
long contentDurationUs = period.getDurationUs();
return getMediaPeriodInfoForAd(currentPeriodId.periodIndex, adGroupCount - 1, 0,
currentMediaPeriodInfo.endPositionUs);
contentDurationUs);
}
}