Skip to content
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

IllegalStateException in MediaControllerImplBase.maskPositionInfo #122

Closed
1 task
ziem opened this issue Jul 19, 2022 · 5 comments
Closed
1 task

IllegalStateException in MediaControllerImplBase.maskPositionInfo #122

ziem opened this issue Jul 19, 2022 · 5 comments
Assignees
Labels

Comments

@ziem
Copy link

ziem commented Jul 19, 2022

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:

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 bugreport to [email protected] after filing this issue.
@marcbaechinger
Copy link
Contributor

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 adGroupIndex and adIndexInAdGroup are written into the PositionInfo.

@marcbaechinger
Copy link
Contributor

I can repro this when I seek with a MediaController over and ad and a SEEK_ADJUSTMENT is 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 the onPositionDiscontinuity event of the player is identical to what the MediaController reports 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
Copy link
Author

ziem commented Aug 12, 2022

Thanks @marcbaechinger for your investigation. Do you want me to create a PR?

@tonihei
Copy link
Collaborator

tonihei commented Aug 12, 2022

@ziem No need for that, a fix is already being submitted in our internal codebase and should appear here soon.

@ziem
Copy link
Author

ziem commented Aug 12, 2022

Okay, thanks 🙂

marcbaechinger added a commit that referenced this issue Sep 30, 2022
The assertion asserts against a `Period` and an `AdPlaybackState` which actually
asserts against a resolved ad which is what `ExoPlayerImplInternal` does later and
what gives us a `SEEK_ADJUSTMENT`. However, this assertion is not required at the
moment of masking, because we are sure that the resolved seek results in a content
period and never an ad period.

#minor-release
Issue: #122
PiperOrigin-RevId: 471827072
microkatz pushed a commit that referenced this issue Nov 22, 2022
The assertion asserts against a `Period` and an `AdPlaybackState` which actually
asserts against a resolved ad which is what `ExoPlayerImplInternal` does later and
what gives us a `SEEK_ADJUSTMENT`. However, this assertion is not required at the
moment of masking, because we are sure that the resolved seek results in a content
period and never an ad period.

#minor-release
Issue: #122
PiperOrigin-RevId: 471827072
(cherry picked from commit 73f8668)
@ziem ziem closed this as completed Oct 22, 2023
@androidx androidx locked and limited conversation to collaborators Dec 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants