Bug 785340 - Part 2: OmxDecoder::ReadVideo() should fail if mVideoSource->read() fails. r=doublec

--HG--
extra : rebase_source : 4b54866b3b994148d0360d1cd814f86169f4a74b
This commit is contained in:
Chris Peterson 2012-09-18 17:37:17 -07:00
parent e941f58f6a
commit 10132572a6

View File

@ -591,16 +591,20 @@ bool OmxDecoder::ReadVideo(VideoFrame *aFrame, int64_t aSeekTimeUs)
}
else if (err == INFO_FORMAT_CHANGED) {
// If the format changed, update our cached info.
LOG("mVideoSource INFO_FORMAT_CHANGED");
if (!SetVideoFormat())
return false;
else
return ReadVideo(aFrame, aSeekTimeUs);
}
else if (err == ERROR_END_OF_STREAM) {
return false;
LOG("mVideoSource END_OF_STREAM");
}
else if (err != OK) {
LOG("mVideoSource ERROR %#x", err);
}
return true;
return err == OK;
}
bool OmxDecoder::ReadAudio(AudioFrame *aFrame, int64_t aSeekTimeUs)
@ -637,11 +641,18 @@ bool OmxDecoder::ReadAudio(AudioFrame *aFrame, int64_t aSeekTimeUs)
}
else if (err == INFO_FORMAT_CHANGED) {
// If the format changed, update our cached info.
LOG("mAudioSource INFO_FORMAT_CHANGED");
if (!SetAudioFormat())
return false;
else
return ReadAudio(aFrame, aSeekTimeUs);
}
else if (err == ERROR_END_OF_STREAM) {
LOG("mAudioSource END_OF_STREAM");
}
else if (err != OK) {
LOG("mAudioSource ERROR %#x", err);
}
return err == OK;
}