You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[VOD DAI - Widevine DRM] Demo app is crashing in ImaServerSideAdInsertionMediaSource when fast forward beyond last Midroll break. #1741
Play a DAI VOD content with multiple midroll ad breaks and when starting playback fast forward to position after the last midroll. The steps to setup the content will be provided in the email sent to android-media-github@google.com.
Expected result
The media plays successfully.
Actual result
Playback crashes with the following stack trace (btw, the issue is also present in Exoplayer 2.19.1 so it is not a regression) :
09-19 15:30:10.390 32585 32585 D AndroidRuntime: Shutting down VM
09-19 15:30:10.391 32585 32585 E AndroidRuntime: FATAL EXCEPTION: main
09-19 15:30:10.391 32585 32585 E AndroidRuntime: Process: androidx.media3.demo.main, PID: 32585
09-19 15:30:10.391 32585 32585 E AndroidRuntime: java.lang.ArrayIndexOutOfBoundsException: length=10; index=10
09-19 15:30:10.391 32585 32585 E AndroidRuntime: at androidx.media3.common.AdPlaybackState.getAdGroup(AdPlaybackState.java:686)
09-19 15:30:10.391 32585 32585 E AndroidRuntime: at androidx.media3.exoplayer.ima.ImaServerSideAdInsertionMediaSource.setVodAdInPlaceholder(ImaServerSideAdInsertionMediaSource.java:903)
09-19 15:30:10.391 32585 32585 E AndroidRuntime: at androidx.media3.exoplayer.ima.ImaServerSideAdInsertionMediaSource.access$3300(ImaServerSideAdInsertionMediaSource.java:114)
09-19 15:30:10.391 32585 32585 E AndroidRuntime: at androidx.media3.exoplayer.ima.ImaServerSideAdInsertionMediaSource$VodAdEventListener.onAdEvent(ImaServerSideAdInsertionMediaSource.java:1497)
09-19 15:30:10.391 32585 32585 E AndroidRuntime: at androidx.media3.exoplayer.ima.ImaServerSideAdInsertionMediaSource$ComponentListener.onAdEvent(ImaServerSideAdInsertionMediaSource.java:1063)
09-19 15:30:10.391 32585 32585 E AndroidRuntime: at com.google.ads.interactivemedia.v3.impl.zzac.zzc(com.google.ads.interactivemedia.v3:interactivemedia@@3.33.0:27)
09-19 15:30:10.391 32585 32585 E AndroidRuntime: at com.google.ads.interactivemedia.v3.impl.zzbr.zzc(com.google.ads.interactivemedia.v3:interactivemedia@@3.33.0:12)
09-19 15:30:10.391 32585 32585 E AndroidRuntime: at com.google.ads.interactivemedia.v3.impl.zzav.zzl(com.google.ads.interactivemedia.v3:interactivemedia@@3.33.0:49)
09-19 15:30:10.391 32585 32585 E AndroidRuntime: at com.google.ads.interactivemedia.v3.impl.zzbc.zzg(com.google.ads.interactivemedia.v3:interactivemedia@@3.33.0:7)
09-19 15:30:10.391 32585 32585 E AndroidRuntime: at com.google.ads.interactivemedia.v3.impl.zzay.onPostMessage(com.google.ads.interactivemedia.v3:interactivemedia@@3.33.0:2)
The commit above should fix the issue, will be released with 1.5.0-beta01 (around end of this month). The problem should only happen in VOD DAI streams without a preroll, where the IMA SDK starts counting ads group from index 1 instead of 0.
I might be wrong but the commit in question may not fix the issue. private static int getAdGroupIndexFromAdPodInfo( AdPodInfo adPodInfo, AdPlaybackState adPlaybackState) { int adPodIndex = adPodInfo.getPodIndex(); if (adPodIndex == -1) { // Post-roll return adPlaybackState.adGroupCount - 1; } if (adPlaybackState.getAdGroup(0).timeUs == 0) { // When a pre-roll exists, the index starts at zero. return adPodIndex; } // Mid-rolls always start at 1. return adPodIndex - 1; }
if preroll AdGroupIndex is 0 and if first midroll adPodIndex is 1 then the AdGroupIndex for that first midroll is also 0 so you would end up with the same AdGroupIndex for preroll and midroll.
would end up with the same AdGroupIndex for preroll and midroll.
If a preroll exists, the index won't be corrected in the new code. See the // When a pre-roll exists, the index starts at zero. return adPodIndex; part of the code you copied in. So the correction only applies if there is no preroll at all.
Activity
miroslawz81 commentedon Sep 19, 2024
The email has been sent with the steps to setup the content.
tonihei commentedon Sep 27, 2024
Note - there is also some information about this in [internal: b/369366766].
Account for missing preroll when converting adPodIndex to adGroupIndex
tonihei commentedon Oct 4, 2024
The commit above should fix the issue, will be released with
1.5.0-beta01(around end of this month). The problem should only happen in VOD DAI streams without a preroll, where the IMA SDK starts counting ads group from index 1 instead of 0.miroslawz81 commentedon Oct 4, 2024
I might be wrong but the commit in question may not fix the issue.
private static int getAdGroupIndexFromAdPodInfo( AdPodInfo adPodInfo, AdPlaybackState adPlaybackState) { int adPodIndex = adPodInfo.getPodIndex(); if (adPodIndex == -1) { // Post-roll return adPlaybackState.adGroupCount - 1; } if (adPlaybackState.getAdGroup(0).timeUs == 0) { // When a pre-roll exists, the index starts at zero. return adPodIndex; } // Mid-rolls always start at 1. return adPodIndex - 1; }if preroll AdGroupIndex is 0 and if first midroll adPodIndex is 1 then the AdGroupIndex for that first midroll is also 0 so you would end up with the same AdGroupIndex for preroll and midroll.
tonihei commentedon Oct 4, 2024
If a preroll exists, the index won't be corrected in the new code. See the
// When a pre-roll exists, the index starts at zero. return adPodIndex;part of the code you copied in. So the correction only applies if there is no preroll at all.miroslawz81 commentedon Nov 15, 2024
Verified the fix with release-1.5.0-rc02 branch and the issue seems to be rectified.