-
Notifications
You must be signed in to change notification settings - Fork 2
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
ExoPlayer crashes, possibly trying to draw on surface which has been destroyed #3
Comments
Thanks for all the details. I'll take a look ASAP. |
By changing the design of MovieLiveWallpaperService and MovieWallpaperRenderer, I was able to resolve this, and cater better for changes in the video being displayed. Currently, SimpleExoPlayer is instantiated in the constructor of MovieLiveWallpaperService and passed to MovieWallpaperRenderer in it's constructor:
I think it is better to release the player when it's not required. Currently the Service holds on to the player for the life of the wallpaper. This means that Video decoder instances are still held by the instance of the player. In addition, the player is not aware when the underlying Surface is being updated. If the video is rendering and MovieWallpaperRenderer createSurfaceTexture() is called, the ExoPlayer can be writing to a Surface which has been destroyed. What I did in my variant of this code, is create/destroy the ExoPlayer instance (not the MediaSource, that's fine to stay created) each time the Wallpaper visibility changes.
In addition I have created a listener interface which the renderer calls when the surface is available (or not)...
I pass the MovieLiveWallpaperService.GLEngine to the Renderer, and call back when the surface is destroyed/created
In the MovieLiveWallpaperService I added the following:
I would say as well, that it might be nice to see this branch in it's own GitRepo. I think this code will be really helpful to people. Some feedback would be to make the name more useful, change the dependancies to be using the main (non beta/alpha) Kotlin/Android Studio toolsets... remove the RecyclerView imports... |
I have submitted another pull request, which I think might solve the issue of ExoPlayer pausing or just going to a black screen |
Did you get that second pull request OK? I can't seem to see it now. Let me know if you can't see it, and I will resubmit. |
I have the same issue |
hope author can solve this issue. |
I have solved this issue |
Reason: exoplayer setPlayWhenReady(true) when onResume, but the glThread will re-create surface, and the last surface will be release. but exoplayer Rendering still going on. |
I've been trying to debug one issue, which is that ExoPlayer stops functioning, and you get a black screen.
To confirm that the OpenGL thread is still rendering, I have modified a test version to include a new OpenGL Program, and a new set of Shaders which just renders some basic shapes. When the black screen occurs, that all still renders correctly. I feel that it's safe to say, that the issue is that ExoPlayer is stopping/crashing. In other words, the OpenGL pipeline still functions.
That seems to be confirmed by the following log's I encountered when the Rendering stops with the following error, which appears related to ExoPlayer.
E/Surface: queueBuffer: error queuing buffer to SurfaceTexture, -19
It might be that the Surface is not being destroyed properly when it becomes invalid. That is mentioned in this persons blog -> https://acadroid.wordpress.com/2017/12/12/queuebuffer-error-queuing-buffer-to-surfacetexture-22/
The text was updated successfully, but these errors were encountered: