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

NPE when remove child media source from (lazy) ConcatenatingMediaSource #4986

Closed
Khang-NT opened this issue Oct 20, 2018 · 1 comment
Closed
Assignees
Labels

Comments

@Khang-NT
Copy link
Contributor

Issue description, Reproduction steps

  1. Create ConcatenatingMediaSource with useLazyPreparation = true
  2. Add some child media source and play
  3. Delete 1 child media source, exoplayer will crash if this media source still not prepared

Link to test content

None

Version of ExoPlayer being used

2.9.0

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

Android 8.0

Stacktrace

com.google.android.exoplayer2.ExoPlaybackException: java.lang.NullPointerException
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:359)
        at android.os.Handler.dispatchMessage(Handler.java:101)
        at android.os.Looper.loop(Looper.java:164)
        at android.os.HandlerThread.run(HandlerThread.java:65)
     Caused by: java.lang.NullPointerException
        at com.google.android.exoplayer2.util.Assertions.checkNotNull(Assertions.java:111)
        at com.google.android.exoplayer2.source.CompositeMediaSource.releaseChildSource(CompositeMediaSource.java:121)
        at com.google.android.exoplayer2.source.ConcatenatingMediaSource.removeMediaSourceInternal(ConcatenatingMediaSource.java:716)
        at com.google.android.exoplayer2.source.ConcatenatingMediaSource.handleMessage(ConcatenatingMediaSource.java:577)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.deliverMessage(ExoPlayerImplInternal.java:871)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.sendMessageToTarget(ExoPlayerImplInternal.java:842)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.sendMessageInternal(ExoPlayerImplInternal.java:824)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:333)
        at android.os.Handler.dispatchMessage(Handler.java:101) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.os.HandlerThread.run(HandlerThread.java:65) 
@tonihei
Copy link
Collaborator

tonihei commented Oct 22, 2018

Thanks for reporting! Going to provide a fix for that.

@tonihei tonihei self-assigned this Oct 22, 2018
@tonihei tonihei added the bug label Oct 22, 2018
ojw28 pushed a commit that referenced this issue Oct 24, 2018
In ConcatenatingMediaSource, the source may be removed before it started
preparing (this may happen if lazyPreparation=true). In this case, we
shouldn't call releaseSource as the preparation didn't start.

Issue:#4986

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=218141658
@ojw28 ojw28 closed this as completed Oct 24, 2018
ojw28 pushed a commit that referenced this issue Oct 24, 2018
In ConcatenatingMediaSource, the source may be removed before it started
preparing (this may happen if lazyPreparation=true). In this case, we
shouldn't call releaseSource as the preparation didn't start.

Issue:#4986

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=218141658
@google google locked and limited conversation to collaborators May 16, 2019
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

3 participants