If your headphone cables are starting to fray or you have a bad habit of getting your cables hung on random items and nearly pulling out (like I do) you may want to consider installing headphone jacks on each earpiece. You'll need two 1/8" mono jacks, two 1/8" mono plugs and heat shrink tubing as well as access to a soldering iron, heat gun and a drill or dremel tool.
Instructables user Nick.D gives step-by-step instructions and photos at the source link below. The basic steps are to diassemble the earpieces of your headphones and install a 1/8" mono jack on each earpiece. This involves prying apart the earpieces, widening the hole in the earpiece with a dremel or drill, wiring/soldering the jack in place and sealing with glue.
Do this for each earpiece and then add the 1/8" mono jacks to the end of each cable. Add heat-shrink tubing to that to ensure a safe long-term connection. This is a great way to give new life to headphones with pulled out cables and ensure that you won't have to worry about snagging the cables out ever again.
Make Your Headphone Cable Removable [Instructables]