Fixed a race condition where some recording frames may not be released.

When startRecording() is called before setListener(), recording frames
are sent right after startRecording(), but there is no listener to
release the recording frames. This causes the hang in media server.

bug - 3166356

Change-Id: I19366ca682ef9f6b847590c190c30a15ed32b8e4
This commit is contained in:
James Dong
2010-11-15 10:38:37 -08:00
parent 64f1163084
commit df7a856d3d
2 changed files with 6 additions and 20 deletions

View File

@@ -372,6 +372,9 @@ void Camera::dataCallbackTimestamp(nsecs_t timestamp, int32_t msgType, const sp<
}
if (listener != NULL) {
listener->postDataTimestamp(timestamp, msgType, dataPtr);
} else {
LOGW("No listener was set. Drop a recording frame.");
releaseRecordingFrame(dataPtr);
}
}