Skip to content

Multi period content support for AdsMediaSource #2501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename parameter
  • Loading branch information
kotucz committed Jun 4, 2025
commit ce4464c394ed3a914e81d1d114124d97c393d1be
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,19 @@ public Period getPeriod(int periodIndex, Period period, boolean setIds) {
* @param adPlaybackState original state is immutable always new modified copy is created
* @param periodStartOffsetUs period start time offset from start of timeline (microseconds)
* @param periodDurationUs period duration (microseconds)
* @param isLast true if this is the last period
* @param isLastPeriod true if this is the last period
* @return adPlaybackState modified for period
*/
private AdPlaybackState forPeriod(
AdPlaybackState adPlaybackState,
long periodStartOffsetUs,
long periodDurationUs,
boolean isLast) {
boolean isLastPeriod) {
final long periodEndUs = periodStartOffsetUs + periodDurationUs;
for (int adGroupIndex = 0; adGroupIndex < adPlaybackState.adGroupCount; adGroupIndex++) {
final long adGroupTimeUs = adPlaybackState.getAdGroup(adGroupIndex).timeUs;
if (adGroupTimeUs == C.TIME_END_OF_SOURCE) {
if (!isLast) {
if (!isLastPeriod) {
adPlaybackState = adPlaybackState.withSkippedAdGroup(adGroupIndex);
}
} else {
Expand Down