It's an aftermarket stereo that I got with the car. The car has an imobiliser so the stereo is hooked directly to the battery so it doesn't lose its settings every time I turn the car off.
There haven't been any problems with it in the couple of months I've had it then this seemed to happen out of nowhere.
EDIT: No flat battery.