EGL 渲染视频 报空指针 麻烦看一下 这是日志
JacksonNing opened this issue · 1 comments
2019-12-30 01:46:47.765 24449-24449/com.cxp.learningvideo E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.cxp.learningvideo, PID: 24449
java.lang.NullPointerException: Attempt to read from null array
at android.opengl.Matrix.scaleM(Matrix.java:472)
at com.cxp.learningvideo.opengl.drawer.VideoDrawer.scale(VideoDrawer.kt:296)
at com.cxp.learningvideo.EGLPlayerActivity$initSecondVideo$2.run(EGLPlayerActivity.kt:60)
at android.os.Handler.handleCallback(Handler.java:792)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6701)
at java.lang.reflect.Method.invoke(Native ### Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:246)
这个问题是因为drawer.scale(0.5f, 0.5f)的时候,VideoDrawer还没有初始化完毕导致里面的矩阵变量没有初始化,所以空指针了。你可以先把drawer.scale(0.5f, 0.5f)去掉,或者延时长一点。我找时间修复一下这个问题。