Commit 3178a623 authored by François Grisez's avatar François Grisez

Handle the case when AMediaCodec_dequeueOutputBuffer() returns...

Handle the case when AMediaCodec_dequeueOutputBuffer() returns AMEDIACODEC_INFO_OUTPUT_FORMAT_CHANGED and AMEDIACODEC_INFO_OUTPUT_BUFFERS_CHANGED consecutively.

Before that fix, the second call to AMediaCodec_dequeueOutputBuffer() was considered as failed
although AMEDIACODEC_INFO_OUTPUT_BUFFERS_CHANGED was returned.
parent 9e76acef
......@@ -129,7 +129,7 @@ MediaCodecDecoder::Status MediaCodecDecoder::fetch(mblk_t *&frame) {
}
oBufidx = AMediaCodec_dequeueOutputBuffer(_impl, &info, _timeoutUs);
if (oBufidx == AMEDIACODEC_INFO_OUTPUT_FORMAT_CHANGED || oBufidx == AMEDIACODEC_INFO_OUTPUT_BUFFERS_CHANGED) {
while (oBufidx == AMEDIACODEC_INFO_OUTPUT_FORMAT_CHANGED || oBufidx == AMEDIACODEC_INFO_OUTPUT_BUFFERS_CHANGED) {
ms_message("MediaCodecDecoder: %s", codecInfoToString(oBufidx).c_str());
if (oBufidx == AMEDIACODEC_INFO_OUTPUT_FORMAT_CHANGED) {
AMediaFormat *format = AMediaCodec_getOutputFormat(_impl);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment