I have always had good luck adding a cup of ammonia to the load of laundry along with detergent and softer as usual, using the hottest water recommended for fabric. If it is truely mildewed I let it soak over night, run thru the cycle. Occasionally, I might run a extra rinse cycle to finish it.
This works well for mildew, sour smells, grease, diesel fuels, car fluids, etc.
*use caution and plenty of ventilation around ammonia)