android: fix video rendering bug when changing resolution during call

This commit is contained in:
Pierre-Eric Pelloux-Prayer 2011-09-13 11:21:31 +02:00
parent 6c24b1de61
commit 2e74475f5b

View file

@ -120,7 +120,7 @@ public class AndroidVideoWindowImpl {
private static class Renderer implements GLSurfaceView.Renderer { private static class Renderer implements GLSurfaceView.Renderer {
int ptr; int ptr;
boolean initPending; boolean initPending;
int width, height; int width=-1, height=-1;
public Renderer() { public Renderer() {
ptr = 0; ptr = 0;
@ -129,6 +129,11 @@ public class AndroidVideoWindowImpl {
public void setOpenGLESDisplay(int ptr) { public void setOpenGLESDisplay(int ptr) {
this.ptr = ptr; this.ptr = ptr;
// if dimension are set, we are recreating MS2 graph without
// recreating the surface => need to force init
if (width > 0 && height > 0) {
initPending = true;
}
} }
public void onDrawFrame(GL10 gl) { public void onDrawFrame(GL10 gl) {