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 in method HlsMediaPeriod#deriveAudioFormat #5868

Closed
hallyhaa opened this issue May 10, 2019 · 1 comment
Closed

NPE in method HlsMediaPeriod#deriveAudioFormat #5868

hallyhaa opened this issue May 10, 2019 · 1 comment
Assignees
Labels

Comments

@hallyhaa
Copy link

[REQUIRED] Issue description

Trying to stream audio using HlsMediaSource and using setAllowChunklessPreparation(true) causes an NPE when buffering. If not using chunkless preparation, the same audio stream plays perfectly. (It also used to play with no problems on exoplayer 2.9.x with the chunkless preparation.)

[REQUIRED] Reproduction steps

Download the exoplayer demo app, search up the HlsMediaSource.Factory use, add .setAllowChunklessPreparation(true) before .createMediaSource(uri) and run the demo.

[REQUIRED] Link to test content

I reproduced this with a streaming audio .m3u8 file that I cannot post a link to here. Will send email. I reduced the exolist.json file to this:

[
  {
    "name": "Name of heading",
    "samples": [
      {
        "name": "Name of sample",
        "uri": "(cannot share here)"
      }
    ]
  }
]

Provide a JSON snippet for the demo app’s media.exolist.json file, or a link to
media that reproduces the issue. If you don't wish to post it publicly, please
submit the issue, then email the link to dev.exoplayer@gmail.com using a subject
in the format "Issue #1234". Provide all the metadata we'd need to play the
content like drm license urls or similar. If the content is accessible only in
certain countries or regions, please say so.

[REQUIRED] A full bug report captured from the device

While you wait for my email with an included bug report, here's a little stack trace:

2019-05-10 11:19:56.597 19396-19933/com.google.android.exoplayer2.demo E/ExoPlayerImplInternal: Internal runtime error.
    java.lang.NullPointerException: Attempt to read from field 'int com.google.android.exoplayer2.Format.roleFlags' on a null object reference
        at com.google.android.exoplayer2.source.hls.HlsMediaPeriod.deriveAudioFormat(HlsMediaPeriod.java:805)
        at com.google.android.exoplayer2.source.hls.HlsMediaPeriod.buildAndPrepareMainSampleStreamWrapper(HlsMediaPeriod.java:626)
        at com.google.android.exoplayer2.source.hls.HlsMediaPeriod.buildAndPrepareSampleStreamWrappers(HlsMediaPeriod.java:458)
        at com.google.android.exoplayer2.source.hls.HlsMediaPeriod.prepare(HlsMediaPeriod.java:146)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.maybeUpdateLoadingPeriod(ExoPlayerImplInternal.java:1619)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.updatePeriods(ExoPlayerImplInternal.java:1482)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:552)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:326)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:214)
        at android.os.HandlerThread.run(HandlerThread.java:65)
2019-05-10 11:19:56.599 19396-19396/com.google.android.exoplayer2.demo E/EventLogger: playerFailed [1.04, 0.00, window=0, period=0]
    com.google.android.exoplayer2.ExoPlaybackException: java.lang.NullPointerException: Attempt to read from field 'int com.google.android.exoplayer2.Format.roleFlags' on a null object reference
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:397)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:214)
        at android.os.HandlerThread.run(HandlerThread.java:65)
     Caused by: java.lang.NullPointerException: Attempt to read from field 'int com.google.android.exoplayer2.Format.roleFlags' on a null object reference
        at com.google.android.exoplayer2.source.hls.HlsMediaPeriod.deriveAudioFormat(HlsMediaPeriod.java:805)
        at com.google.android.exoplayer2.source.hls.HlsMediaPeriod.buildAndPrepareMainSampleStreamWrapper(HlsMediaPeriod.java:626)
        at com.google.android.exoplayer2.source.hls.HlsMediaPeriod.buildAndPrepareSampleStreamWrappers(HlsMediaPeriod.java:458)
        at com.google.android.exoplayer2.source.hls.HlsMediaPeriod.prepare(HlsMediaPeriod.java:146)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.maybeUpdateLoadingPeriod(ExoPlayerImplInternal.java:1619)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.updatePeriods(ExoPlayerImplInternal.java:1482)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:552)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:326)
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:214) 
        at android.os.HandlerThread.run(HandlerThread.java:65) 

[REQUIRED] Version of ExoPlayer being used

2.10.0

[REQUIRED] Device(s) and version(s) of Android being used

Samsung Galaxy S9 running android 9. The error happens consistently.

@tonihei
Copy link
Collaborator

tonihei commented May 10, 2019

Thanks for reporting, we'll provide a fix for that!

ojw28 pushed a commit that referenced this issue May 15, 2019
Issue:#5868
PiperOrigin-RevId: 247613811
@ojw28 ojw28 closed this as completed May 15, 2019
ojw28 pushed a commit that referenced this issue May 15, 2019
Issue:#5868
PiperOrigin-RevId: 247613811
@google google locked and limited conversation to collaborators Sep 27, 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