summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioRecord.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-02-24 15:21:10 -0800
committerGlenn Kasten <gkasten@google.com>2014-02-25 15:20:49 -0800
commitc08d20b6a37122ebf116262c9372509ed060d4c1 (patch)
treeea9f9586612094d800e2a3498f0b9b4573f609ad /media/libmedia/AudioRecord.cpp
parent045e739161f5ae00321a6cfba20935abb791005b (diff)
downloadframeworks_av-c08d20b6a37122ebf116262c9372509ed060d4c1.zip
frameworks_av-c08d20b6a37122ebf116262c9372509ed060d4c1.tar.gz
frameworks_av-c08d20b6a37122ebf116262c9372509ed060d4c1.tar.bz2
Simplify error handling after track creation
IAudioFlinger::createTrack and IAudioFlinger::openRecord both guarantee that (status == OK) == (sp<> != 0). Change-Id: I91cb4f7e843019efb65cace7ba146f7da7aa5b59
Diffstat (limited to 'media/libmedia/AudioRecord.cpp')
-rw-r--r--media/libmedia/AudioRecord.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index 7f86032..4438dfd 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -482,10 +482,12 @@ status_t AudioRecord::openRecord_l(size_t epoch)
ALOGE_IF(originalSessionId != AUDIO_SESSION_ALLOCATE && mSessionId != originalSessionId,
"session ID changed from %d to %d", originalSessionId, mSessionId);
- if (record == 0 || status != NO_ERROR) {
+ if (status != NO_ERROR) {
ALOGE("AudioFlinger could not create record track, status: %d", status);
goto release;
}
+ ALOG_ASSERT(record != 0);
+
// AudioFlinger now owns the reference to the I/O handle,
// so we are no longer responsible for releasing it.