Endocarditis, most often from a bacterial infection, inflames the lining of your heart valves and chambers. Treatment includes several weeks of antibiotics or other medicine and sometimes surgery. With quick, aggressive treatment, many people survive. Without treatment, endocarditis can be fatal.