Replace two 'return AVERROR(EAGAIN);' by continue. The latter are nicer