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

Wrapping AdMediaSource causes a runtime crash #4591

Closed
arazabishov opened this issue Jul 27, 2018 · 1 comment
Closed

Wrapping AdMediaSource causes a runtime crash #4591

arazabishov opened this issue Jul 27, 2018 · 1 comment
Assignees

Comments

@arazabishov
Copy link

Issue description

Placing instance of AdMediaSource within a composite media source like ConcatenatingMediaSource will cause a crash within AdsMediaSource.prepareSourceInternal in the Assertions.checkArgument(isTopLevelSource). As far as I understand, the AdMediaSource is not supposed to be wrapped into another MediaSource, which seems counterintuitive to me. Documentation also doesn't describe this limitation in a clear way.

Reproduction steps

It is easily reproducible in the imademo app. Wrap AdMediaSource into ConcatenatingMediaSource before sending it into ExoPlayer.

Version of ExoPlayer being used

2.8.2

Device(s) and version(s) of Android being used

Android 8.1.0, Google Pixel XL

A full bug report captured from the device

2018-07-27 13:53:13.112 3697-3831/com.google.android.exoplayer2.imademo E/ExoPlayerImplInternal: Internal runtime error.
    java.lang.IllegalArgumentException
        at com.google.android.exoplayer2.util.Assertions.checkArgument(Assertions.java:39)
        at com.google.android.exoplayer2.source.ads.AdsMediaSource.prepareSourceInternal(AdsMediaSource.java:312)
        at com.google.android.exoplayer2.source.BaseMediaSource.prepareSource(BaseMediaSource.java:137)
        at com.google.android.exoplayer2.source.CompositeMediaSource.prepareChildSource(CompositeMediaSource.java:109)
        at com.google.android.exoplayer2.source.ConcatenatingMediaSource.addMediaSourceInternal(ConcatenatingMediaSource.java:554)
        at com.google.android.exoplayer2.source.ConcatenatingMediaSource.addMediaSourcesInternal(ConcatenatingMediaSource.java:560)
        at com.google.android.exoplayer2.source.ConcatenatingMediaSource.prepareSourceInternal(ConcatenatingMediaSource.java:390)
        at com.google.android.exoplayer2.source.BaseMediaSource.prepareSource(BaseMediaSource.java:137)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.prepareInternal(ExoPlayerImplInternal.java:396)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:286)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:164)
        at android.os.HandlerThread.run(HandlerThread.java:65)
    
    
    --------- beginning of crash
2018-07-27 13:53:13.113 3697-3831/com.google.android.exoplayer2.imademo E/AndroidRuntime: FATAL EXCEPTION: ExoPlayerImplInternal:Handler
    Process: com.google.android.exoplayer2.imademo, PID: 3697
    java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.exoplayer2.source.ads.AdsMediaSource$ComponentListener.release()' on a null object reference
        at com.google.android.exoplayer2.source.ads.AdsMediaSource.releaseSourceInternal(AdsMediaSource.java:382)
        at com.google.android.exoplayer2.source.BaseMediaSource.releaseSource(BaseMediaSource.java:150)
        at com.google.android.exoplayer2.source.CompositeMediaSource.releaseSourceInternal(CompositeMediaSource.java:65)
        at com.google.android.exoplayer2.source.ConcatenatingMediaSource.releaseSourceInternal(ConcatenatingMediaSource.java:423)
        at com.google.android.exoplayer2.source.BaseMediaSource.releaseSource(BaseMediaSource.java:150)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.resetInternal(ExoPlayerImplInternal.java:802)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.stopInternal(ExoPlayerImplInternal.java:731)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:353)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:164)
        at android.os.HandlerThread.run(HandlerThread.java:65)
@andrewlewis andrewlewis self-assigned this Jul 27, 2018
@andrewlewis
Copy link
Collaborator

#3750 tracks removing this limitation. I'll add a note to the class javadoc to document it.

ojw28 pushed a commit that referenced this issue Aug 1, 2018
Issue: #4591

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206307948
@google google locked and limited conversation to collaborators Dec 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants