diff options
author | James Dong <jdong@google.com> | 2011-01-25 12:37:43 -0800 |
---|---|---|
committer | James Dong <jdong@google.com> | 2011-01-25 15:30:34 -0800 |
commit | d7ef5b6febf5e645a7757bd48d30af9c051fabf6 (patch) | |
tree | 93005deac2fe88c4d7a5c7823585570e5f51fa9b /media/libstagefright/AudioSource.cpp | |
parent | f95bd0feb57f1503be7c08083c0a4d22286256e8 (diff) | |
download | frameworks_base-d7ef5b6febf5e645a7757bd48d30af9c051fabf6.zip frameworks_base-d7ef5b6febf5e645a7757bd48d30af9c051fabf6.tar.gz frameworks_base-d7ef5b6febf5e645a7757bd48d30af9c051fabf6.tar.bz2 |
Report errors to applications if AudioRecord->start() fails
bug - 3385198
Change-Id: I86ac8071eb28a538b333e102192193d1b9eda5eb
Diffstat (limited to 'media/libstagefright/AudioSource.cpp')
-rw-r--r-- | media/libstagefright/AudioSource.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/media/libstagefright/AudioSource.cpp b/media/libstagefright/AudioSource.cpp index 235d752..f96df18 100644 --- a/media/libstagefright/AudioSource.cpp +++ b/media/libstagefright/AudioSource.cpp @@ -91,14 +91,17 @@ status_t AudioSource::start(MetaData *params) { mStartTimeUs = startTimeUs; } status_t err = mRecord->start(); - if (err == OK) { mGroup = new MediaBufferGroup; mGroup->add_buffer(new MediaBuffer(kMaxBufferSize)); mStarted = true; + } else { + delete mRecord; + mRecord = NULL; } + return err; } |