Skip to content

Commit

Permalink
Fix: fix to ignore errors in case of multiperiod DASH CSAI (#72)
Browse files Browse the repository at this point in the history
Co-authored-by: Arnold Szabo <szaboaarnold@gmail.com>
  • Loading branch information
guoen21 and szaboa committed Feb 7, 2023
1 parent 0179cc1 commit a71cbf2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions demos/main/src/main/assets/media.exolist.json
Expand Up @@ -510,6 +510,11 @@
"uri": "https://storage.googleapis.com/exoplayer-test-media-1/mkv/android-screens-lavf-56.36.100-aac-avc-main-1280x720.mkv",
"ad_tag_uri": "https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator="
},
{
"name": "Single inline linear MULTIPERIOD",
"uri": "https://dash.akamaized.net/dash264/TestCases/5a/nomor/1.mpd",
"ad_tag_uri": "https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator="
},
{
"name": "Single skippable inline",
"uri": "https://storage.googleapis.com/exoplayer-test-media-1/mkv/android-screens-lavf-56.36.100-aac-avc-main-1280x720.mkv",
Expand Down
Expand Up @@ -263,7 +263,8 @@ protected void onChildSourceInfoRefreshed(
checkNotNull(adMediaSourceHolders[adGroupIndex][adIndexInAdGroup])
.handleSourceInfoRefresh(newTimeline);
} else {
Assertions.checkArgument(newTimeline.getPeriodCount() == 1);
// Workaround to ignore multiperiod csai exceptions
// Assertions.checkArgument(newTimeline.getPeriodCount() == 1);
contentTimeline = newTimeline;
}
maybeUpdateSourceInfo();
Expand Down Expand Up @@ -332,7 +333,8 @@ private void maybeUpdateAdMediaSources() {
private void maybeUpdateSourceInfo() {
@Nullable Timeline contentTimeline = this.contentTimeline;
if (adPlaybackState != null && contentTimeline != null) {
if (adPlaybackState.adGroupCount == 0) {
// Workaround to ignore multiperiod csai exceptions
if (adPlaybackState.adGroupCount == 0 || contentTimeline.getPeriodCount() > 1) {
refreshSourceInfo(contentTimeline);
} else {
adPlaybackState = adPlaybackState.withAdDurationsUs(getAdDurationsUs());
Expand Down

0 comments on commit a71cbf2

Please sign in to comment.