Repository navigation
IllegalStateException in MediaControllerImplBase.maskPositionInfo #122
Copy link
Copy link
Closed
Labels
Description
Media3 Version
1.0.0-beta01
Devices that reproduce the issue
Pixel 5 running Android 12
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
It's reproducible in the session demo with some modifications. To expose this issue, you need to configure ads support/IMA like it's done in the main sample.
Steps:
- open attached video
- let pre-roll finish
- touch seekbar and scroll past mid-roll ads
- 💥
Expected result
Seek should finish without crash, all mid-rolls should be played
Actual result
App crashes
Media
VMAP pre-roll single ad, mid-roll optimized pod with 3 ads, post-roll single ad:
- url: https://storage.googleapis.com/exoplayer-test-media-1/mkv/android-screens-lavf-56.36.100-aac-avc-main-1280x720.mkv
- ad url: https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpostoptimizedpod&cmsid=496&vid=short_onecue&correlator=
Stack trace
E/InputEventReceiver: Exception dispatching input event.
E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
E/MessageQueue-JNI: java.lang.IllegalStateException
at androidx.media3.common.util.Assertions.checkState(Assertions.java:85)
at androidx.media3.session.MediaControllerImplBase.maskPositionInfo(MediaControllerImplBase.java:2645)
at androidx.media3.session.MediaControllerImplBase.seekToInternal(MediaControllerImplBase.java:2050)
at androidx.media3.session.MediaControllerImplBase.seekTo(MediaControllerImplBase.java:539)
at androidx.media3.session.MediaController.seekTo(MediaController.java:576)
at androidx.media3.ui.PlayerControlView.seekTo(PlayerControlView.java:1359)
at androidx.media3.ui.PlayerControlView.seekToTimeBarPosition(PlayerControlView.java:1354)
at androidx.media3.ui.PlayerControlView.access$1700(PlayerControlView.java:189)
at androidx.media3.ui.PlayerControlView$ComponentListener.onScrubStop(PlayerControlView.java:1649)
at androidx.media3.ui.DefaultTimeBar.stopScrubbing(DefaultTimeBar.java:815)
at androidx.media3.ui.DefaultTimeBar.onTouchEvent(DefaultTimeBar.java:619)
at android.view.View.dispatchTouchEvent(View.java:14599)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3120)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2801)
at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:498)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1890)
at android.app.Activity.dispatchTouchEvent(Activity.java:4202)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:456)
at android.view.View.dispatchPointerEvent(View.java:14858)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:6452)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:6253)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5731)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5788)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5754)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:5919)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5762)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:5976)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5735)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:5788)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:5754)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:5762)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:5735)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:8702)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:8653)
Bug Report
- You will email the zip file produced by
adb bugreportto dev.exoplayer@gmail.com after filing this issue.
Reactions are currently unavailable
Activity
marcbaechinger commentedon Jul 27, 2022
You are running into an assertion that checks that no ads are playing.
I'm not quite sure why this assertion is there tbh. Because a few lines further down
adGroupIndexandadIndexInAdGroupare written into thePositionInfo.marcbaechinger commentedon Jul 28, 2022
I can repro this when I seek with a
MediaControllerover and ad and aSEEK_ADJUSTMENTis done to play the add that the user tried to seek over it. When I remove the assertion, this works fine. I also verified that theonPositionDiscontinuityevent of the player is identical to what theMediaControllerreports and that looks fine.I think this assertion can be safely removed to avoid this crash. It's unclear to me what it should prevent.
ziem commentedon Aug 12, 2022
Thanks @marcbaechinger for your investigation. Do you want me to create a PR?
tonihei commentedon Aug 12, 2022
@ziem No need for that, a fix is already being submitted in our internal codebase and should appear here soon.
ziem commentedon Aug 12, 2022
Okay, thanks 🙂
Remove assertion that prevents masking of ad periods
Remove assertion that prevents masking of ad periods