The underlying mechanism is the failure of the Eustachian tube to open during increases in ambient pressure.
If you see blood or pus draining from the ear, you may have a perforated eardrum. Do not put drops or water in the ear. how to treat ear barotrauma
Preventing recurrence is key, especially for frequent travelers or divers. The underlying mechanism is the failure of the