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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user