Try connecting it to a different source, i.e., computer sound card, CD, DVD, receiver, and so on. If the problem continues even though you change the source, then replace the cable. I'm not sure which headphones you own. For instance, the cables on the Sennheiser HD audiophile series are replaceable. Even some of Sennheiser's DJ headphone have replaceable cables. Check the manufacturer's website or ask us.
In my case, it was the jack.