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
This commit is contained in:
@@ -98,6 +98,7 @@ AVCEncoder::AVCEncoder(
|
||||
: mSource(source),
|
||||
mMeta(meta),
|
||||
mNumInputFrames(-1),
|
||||
mPrevTimestampUs(-1),
|
||||
mStarted(false),
|
||||
mInputBuffer(NULL),
|
||||
mInputFrameData(NULL),
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user