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

NullPointerException for subtitles of DASH content #2596

Closed
ChernyshovYuriy opened this issue Mar 23, 2017 · 0 comments
Closed

NullPointerException for subtitles of DASH content #2596

ChernyshovYuriy opened this issue Mar 23, 2017 · 0 comments
Labels

Comments

@ChernyshovYuriy
Copy link

There is NullPointerException when select subtitles of the DASH content.
URL to test (clear DASH):

http://bitmovin-a.akamaihd.net/content/sintel/sintel.mpd

Steps:

  • run ExoPlayer test application with provided URL
  • once video started, select any subtitle track and press OK
  • observe NullPointerException

Stacktrace:

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.exoplayer2.Format[] com.google.android.exoplayer2.source.chunk.ChunkExtractorWrapper.getSampleFormats()' on a null object reference
                          at com.google.android.exoplayer2.source.dash.DefaultDashChunkSource.getNextChunk(DefaultDashChunkSource.java:188)
                          at com.google.android.exoplayer2.source.chunk.ChunkSampleStream.continueLoading(ChunkSampleStream.java:327)
                          at com.google.android.exoplayer2.source.CompositeSequenceableLoader.continueLoading(CompositeSequenceableLoader.java:55)
                          at com.google.android.exoplayer2.source.dash.DashMediaPeriod.continueLoading(DashMediaPeriod.java:196)
                          at com.google.android.exoplayer2.ExoPlayerImplInternal.maybeContinueLoading(ExoPlayerImplInternal.java:1301)
                          at com.google.android.exoplayer2.ExoPlayerImplInternal.reselectTracksInternal(ExoPlayerImplInternal.java:808)
                          at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:328)
                          at android.os.Handler.dispatchMessage(Handler.java:98) 
                          at android.os.Looper.loop(Looper.java:154) 
                          at android.os.HandlerThread.run(HandlerThread.java:61) 
                          at com.google.android.exoplayer2.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40) 

My notes:
Simple null pointer check solves problem.
Current in market code:

if (representationHolder.extractorWrapper.getSampleFormats() == null) {
      pendingInitializationUri = selectedRepresentation.getInitializationUri();
    }

changes applied in order to avoid NullPointerException:

if (representationHolder.extractorWrapper == null || representationHolder.extractorWrapper.getSampleFormats() == null) {
      pendingInitializationUri = selectedRepresentation.getInitializationUri();
    }
@ojw28 ojw28 added the bug label Mar 23, 2017
@ojw28 ojw28 closed this as completed Mar 23, 2017
ojw28 added a commit that referenced this issue Mar 23, 2017
Issue: #2596

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151013802
@google google locked and limited conversation to collaborators Aug 3, 2017
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

2 participants