diff options
author | John Reck <jreck@google.com> | 2012-10-01 15:26:43 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2012-10-01 15:26:43 -0700 |
commit | a75966002946f0f83df427c55694e688a611ed54 (patch) | |
tree | 5046cb8630ee59b7a285d37d186d67478b4d867c /src | |
parent | bc918cd870e8bbbb7def7433d17518d663806d6d (diff) | |
download | Camera-a75966002946f0f83df427c55694e688a611ed54.tar.gz |
Verify we are receiving a callback for the current ST
Bug: 7217305
Calling updateTexImage before the first onFrameAvailable call
will result in white being drawn. mFirstFrameArrived is supposed to
guard against this, however it didn't make sure that it is the current
SurfaceTexture that has a new frame. This can happen during the mode switching
as we might receive an onFrameAvailable for the old, recycled surface texture
Change-Id: I3f471ffff22b0c14a5cc06713329fa05e5bf3f6e
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/CameraScreenNail.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/com/android/camera/CameraScreenNail.java b/src/com/android/camera/CameraScreenNail.java index 2e820c10..d981af38 100644 --- a/src/com/android/camera/CameraScreenNail.java +++ b/src/com/android/camera/CameraScreenNail.java @@ -292,6 +292,9 @@ public class CameraScreenNail extends SurfaceTextureScreenNail { @Override public void onFrameAvailable(SurfaceTexture surfaceTexture) { synchronized (mLock) { + if (getSurfaceTexture() != surfaceTexture) { + return; + } mFirstFrameArrived = true; if (mVisible) { if (mAnimState == ANIM_SWITCH_WAITING_FIRST_FRAME) { |