diff --git a/dom/media/omx/MediaCodecReader.cpp b/dom/media/omx/MediaCodecReader.cpp index 7f1e967e2c8d..ea5de9d9819d 100644 --- a/dom/media/omx/MediaCodecReader.cpp +++ b/dom/media/omx/MediaCodecReader.cpp @@ -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; }