diff options
author | Glenn Kasten <gkasten@google.com> | 2013-06-13 13:47:02 -0700 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2013-06-13 14:02:18 -0700 |
commit | e2ffd5b583da9d30d96710b0e8879e90b2b51d30 (patch) | |
tree | 9e03c688b0f8d3c807de2ca4233552eeb756a8cd /media/libstagefright/AudioSource.cpp | |
parent | 04411d3ed343added179703837c6c24444acce3b (diff) | |
download | frameworks_av-e2ffd5b583da9d30d96710b0e8879e90b2b51d30.zip frameworks_av-e2ffd5b583da9d30d96710b0e8879e90b2b51d30.tar.gz frameworks_av-e2ffd5b583da9d30d96710b0e8879e90b2b51d30.tar.bz2 |
AudioRecord must be used as sp<> only
Bug: 9423855
Change-Id: I78ba8228c60dff11fb466156bb632c5dda45cdaf
Diffstat (limited to 'media/libstagefright/AudioSource.cpp')
-rw-r--r-- | media/libstagefright/AudioSource.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/media/libstagefright/AudioSource.cpp b/media/libstagefright/AudioSource.cpp index 3cf4d5c..bdd842f 100644 --- a/media/libstagefright/AudioSource.cpp +++ b/media/libstagefright/AudioSource.cpp @@ -49,8 +49,7 @@ static void AudioRecordCallbackFunction(int event, void *user, void *info) { AudioSource::AudioSource( audio_source_t inputSource, uint32_t sampleRate, uint32_t channelCount) - : mRecord(NULL), - mStarted(false), + : mStarted(false), mSampleRate(sampleRate), mPrevSampleTimeUs(0), mNumFramesReceived(0), @@ -91,9 +90,6 @@ AudioSource::~AudioSource() { if (mStarted) { reset(); } - - delete mRecord; - mRecord = NULL; } status_t AudioSource::initCheck() const { @@ -122,8 +118,7 @@ status_t AudioSource::start(MetaData *params) { if (err == OK) { mStarted = true; } else { - delete mRecord; - mRecord = NULL; + mRecord.clear(); } |