Merge "Return ERROR_END_OF_STREAM when the input source reaches eos"

This commit is contained in:
James Dong
2011-07-01 08:35:25 -07:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 4 deletions

View File

@@ -475,7 +475,9 @@ status_t AVCEncoder::read(
}
status_t err = mSource->read(&mInputBuffer, options);
if (err != OK) {
LOGE("Failed to read input video frame: %d", err);
if (err != ERROR_END_OF_STREAM) {
LOGE("Failed to read input video frame: %d", err);
}
outputBuffer->release();
return err;
}

View File

@@ -398,10 +398,13 @@ status_t M4vH263Encoder::read(
}
// Ready for accepting an input video frame
if (OK != mSource->read(&mInputBuffer, options)) {
LOGE("Failed to read from data source");
status_t err = mSource->read(&mInputBuffer, options);
if (OK != err) {
if (err != ERROR_END_OF_STREAM) {
LOGE("Failed to read from data source");
}
outputBuffer->release();
return UNKNOWN_ERROR;
return err;
}
if (mInputBuffer->size() - ((mVideoWidth * mVideoHeight * 3) >> 1) != 0) {