Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

NullPointerException when disable text renderer in case of sideloaded track #1854

Closed
ChernyshovYuriy opened this issue Sep 24, 2016 · 5 comments
Labels

Comments

@ChernyshovYuriy
Copy link

ChernyshovYuriy commented Sep 24, 2016

ExoPlayer v2.
I do load dash source with side loaded vtt tracks in the way described in:
#1853
When I set text renderer disabled in the way:

mTrackSelector.setRendererDisabled(rendererIndex, true);

I do experience:

09-23 20:01:03.100 E: Internal runtime error.
                      java.lang.NullPointerException: Attempt to invoke interface method 'void com.google.android.exoplayer2.Renderer.render(long, long)' on a null object reference
                          at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:430)
                          at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:265)
                          at android.os.Handler.dispatchMessage(Handler.java:98)
                          at android.os.Looper.loop(Looper.java:148)
                          at android.os.HandlerThread.run(HandlerThread.java:61)
                          at com.google.android.exoplayer2.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)

Meanwhile, disable audio renderer works well.
Please, let me know what kind of additional information you do need to process this issue.

@ojw28
Copy link
Contributor

ojw28 commented Sep 26, 2016

I think you're somehow managing to include a null entry in the array of TrackRenderer instances passed to ExoPlayer.prepare, which would be a bug in your application code. Either way it should be pretty easy to attach a debugger and work out why the player is trying to invoke a method on a null TrackRenderer.

@ojw28 ojw28 closed this as completed Sep 26, 2016
@ChernyshovYuriy
Copy link
Author

ChernyshovYuriy commented Oct 3, 2016

It is still reproducible with the latest ExoPlayer 2.0.1.
Steps to reproduce:

  • Add side-loaded track.
  • Try to disable it.
  • Observe exception attached.

Could you re-open it?

Stack trace:

10-03 16:35:39.453 E: ExoPlayerEventLogger.onPlayerError(127)   playerFailed [18.45]
                      com.google.android.exoplayer2.ExoPlaybackException
                          at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:315)
                          at android.os.Handler.dispatchMessage(Handler.java:98)
                          at android.os.Looper.loop(Looper.java:148)
                          at android.os.HandlerThread.run(HandlerThread.java:61)
                          at com.google.android.exoplayer2.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
                       Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void com.google.android.exoplayer2.Renderer.setCurrentStreamIsFinal()' on a null object reference
                          at com.google.android.exoplayer2.ExoPlayerImplInternal.updatePeriods(ExoPlayerImplInternal.java:1001)
                          at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:413)
                          at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:265)
                          at android.os.Handler.dispatchMessage(Handler.java:98) 
                          at android.os.Looper.loop(Looper.java:148) 
                          at android.os.HandlerThread.run(HandlerThread.java:61) 
                          at com.google.android.exoplayer2.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40) 
                        (QPServiceBinder-Thread)
10-03 16:35:39.455 D: ExoPlayerVstbImpl$ExoPlayerListener.onPlayerError(1580)   Caused by:NullPointerException  (QPServiceBinder-Thread)
10-03 16:35:39.465 E: Stop failed.
                      java.lang.NullPointerException: Attempt to invoke interface method 'int com.google.android.exoplayer2.Renderer.getState()' on a null object reference
                          at com.google.android.exoplayer2.ExoPlayerImplInternal.ensureStopped(ExoPlayerImplInternal.java:663)
                          at com.google.android.exoplayer2.ExoPlayerImplInternal.resetInternal(ExoPlayerImplInternal.java:620)
                          at com.google.android.exoplayer2.ExoPlayerImplInternal.stopInternal(ExoPlayerImplInternal.java:599)
                          at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:317)
                          at android.os.Handler.dispatchMessage(Handler.java:98)
                          at android.os.Looper.loop(Looper.java:148)
                          at android.os.HandlerThread.run(HandlerThread.java:61)
                          at com.google.android.exoplayer2.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)

@ojw28 ojw28 reopened this Oct 3, 2016
@ojw28 ojw28 added the bug label Oct 3, 2016
@ojw28
Copy link
Contributor

ojw28 commented Oct 3, 2016

We will push a fix for this tomorrow.

@ChernyshovYuriy
Copy link
Author

Thanks guys!

ojw28 added a commit that referenced this issue Oct 4, 2016
- Correctly null out streams[j] in the case that a renderer
  is being disabled.
- Read discontinuities from all children, not just enabled
  ones. This fixes a failure when reading a discontinuity
  with all renderers disabled.
- Add in some assertions to make incorrect stream selection
  failures obvious and immediate.
- Relocate subtitles so they're above the shutter (needed so
  they continue to be visible when video is disabled but
  text is still enabled).

Issue: #1854

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135089944
@ojw28 ojw28 closed this as completed Oct 4, 2016
@ChernyshovYuriy
Copy link
Author

Just verified proposed solution. Working as designed and as desired :-)
Thanks guys!

@google google locked and limited conversation to collaborators Jun 28, 2017
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants