summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2012-10-01 15:26:43 -0700
committerJohn Reck <jreck@google.com>2012-10-01 15:26:43 -0700
commita75966002946f0f83df427c55694e688a611ed54 (patch)
tree5046cb8630ee59b7a285d37d186d67478b4d867c /src
parentbc918cd870e8bbbb7def7433d17518d663806d6d (diff)
downloadCamera-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.java3
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) {