diff options
author | James Dong <jdong@google.com> | 2010-08-12 15:41:11 -0700 |
---|---|---|
committer | James Dong <jdong@google.com> | 2010-08-12 16:47:17 -0700 |
commit | abfedebe61a010bcce16a0d920c132dfe4ad5c31 (patch) | |
tree | 3d8471d51432251efbac298239f93ef80c896f3d | |
parent | b9299d167f48f2562540cab8b0cf5959a7645503 (diff) | |
download | frameworks_av-abfedebe61a010bcce16a0d920c132dfe4ad5c31.zip frameworks_av-abfedebe61a010bcce16a0d920c132dfe4ad5c31.tar.gz frameworks_av-abfedebe61a010bcce16a0d920c132dfe4ad5c31.tar.bz2 |
Mainly fix two mistakes that I made:
1. When the ERROR_END_OF_STREAM is returned from read, the input buffer is not initialized
release it would lead to crash
2. The mPrevTimestampUs is not initialized and thus fail in the CHECK(mPrevTimestampUs, timeUs)
Change-Id: Id1e51575fb8b3ca48e80547efd3a3a82dfac773b
-rw-r--r-- | media/libstagefright/codecs/avc/enc/AVCEncoder.cpp | 1 | ||||
-rw-r--r-- | media/libstagefright/codecs/m4v_h263/enc/M4vH263Encoder.cpp | 3 |
2 files changed, 2 insertions, 2 deletions
diff --git a/media/libstagefright/codecs/avc/enc/AVCEncoder.cpp b/media/libstagefright/codecs/avc/enc/AVCEncoder.cpp index a99186b..389180c 100644 --- a/media/libstagefright/codecs/avc/enc/AVCEncoder.cpp +++ b/media/libstagefright/codecs/avc/enc/AVCEncoder.cpp @@ -98,6 +98,7 @@ AVCEncoder::AVCEncoder( : mSource(source), mMeta(meta), mNumInputFrames(-1), + mPrevTimestampUs(-1), mStarted(false), mInputBuffer(NULL), mInputFrameData(NULL), diff --git a/media/libstagefright/codecs/m4v_h263/enc/M4vH263Encoder.cpp b/media/libstagefright/codecs/m4v_h263/enc/M4vH263Encoder.cpp index 5ea5859..a011137 100644 --- a/media/libstagefright/codecs/m4v_h263/enc/M4vH263Encoder.cpp +++ b/media/libstagefright/codecs/m4v_h263/enc/M4vH263Encoder.cpp @@ -69,6 +69,7 @@ M4vH263Encoder::M4vH263Encoder( mMeta(meta), mNumInputFrames(-1), mNextModTimeUs(0), + mPrevTimestampUs(-1), mStarted(false), mInputBuffer(NULL), mInputFrameData(NULL), @@ -292,8 +293,6 @@ status_t M4vH263Encoder::read( if (OK != mSource->read(&mInputBuffer, options)) { LOGE("Failed to read from data source"); outputBuffer->release(); - mInputBuffer->release(); - mInputBuffer = NULL; return UNKNOWN_ERROR; } |