Parser::Parser()
: mBufferPos(0),
- mSuspended(false) {
+ mSuspended(false),
+ mFinalResult(OK) {
}
Parser::~Parser() {
if (n < (ssize_t)needed) {
ALOGI("%s", "Reached EOF");
+ if (n < 0) {
+ mFinalResult = n;
+ } else if (n == 0) {
+ mFinalResult = ERROR_END_OF_STREAM;
+ } else {
+ mFinalResult = ERROR_IO;
+ }
} else {
mBuffer->setRange(0, mBuffer->size() + n);
(new AMessage(kWhatProceed, id()))->post();
TrackInfo *info, sp<TrackFragment> *fragment, SampleInfo *sampleInfo) {
for (;;) {
if (info->mFragments.empty()) {
+ if (mFinalResult != OK) {
+ return mFinalResult;
+ }
+
resumeIfNecessary();
return -EWOULDBLOCK;
}