Commit c28a2a41 by andrewlewis Committed by Oliver Woodman

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