Bug 1154194 - Call FillCodecInputData before dequeueOutputBuffer, remove the check of FillCodecInputData. r=sotaro

This commit is contained in:
Benjamin Chen 2015-05-22 14:25:51 +08:00
Родитель 2dcbea5eae
Коммит 9a3bbcae4e
1 изменённых файлов: 3 добавлений и 8 удалений

Просмотреть файл

@ -1869,6 +1869,7 @@ MediaCodecReader::EnsureCodecFormatParsed(Track& aTrack)
size_t size = 0;
int64_t timeUs = INT64_C(0);
uint32_t flags = 0;
FillCodecInputData(aTrack);
while ((status = aTrack.mCodec->dequeueOutputBuffer(&index, &offset, &size,
&timeUs, &flags)) != INFO_FORMAT_CHANGED) {
if (status == OK) {
@ -1879,17 +1880,11 @@ MediaCodecReader::EnsureCodecFormatParsed(Track& aTrack)
NS_WARNING("Couldn't get output buffers from MediaCodec");
return false;
}
} else if (status != -EAGAIN && status != INVALID_OPERATION){
} else if (status != -EAGAIN && status != INVALID_OPERATION) {
// FIXME: let INVALID_OPERATION pass?
return false; // something wrong!!!
}
status = FillCodecInputData(aTrack);
if (status == INFO_FORMAT_CHANGED) {
break;
} else if (status != OK) {
return false;
}
FillCodecInputData(aTrack);
}
return aTrack.mCodec->getOutputFormat(&format) == OK;
}