Is there a story or a mentioning about masturbation in the Buddhist teachings? Is masturbation wrong? In what exact way is it wrong? I just need to know if the act of masturbation is wrong. This may include watching nudity while masturbating. Even though it's an addiction, I was wandering if it hold more or any negative karma than another general addiction, like addiction to food. I just need your opinion in this backed up by references to the teachings.  
Is the act of masturbation a barrier towards mental concentration or samadhi? Will I have more mindfulness and concentration if I get rid of this addiction? I'm talking about the samadhi gained through annapanasati.
In what way can I get rid of this addiction if it is leading me away from the path? Please give instructions to one who is somewhat deeply ingrained in it.


I am not here to discuss about an 'embarrassing' topic, rather a plausible problem (affirmed by many Buddhists) that a majority of people in the western world have. I am also here to see if my addiction can be a cause for any other negative habits, like many Buddhist say so. That being said, thank you very much for the help. I honestly will appreciate the answer you give me, since this idea have haunted and caused inner conflicts within me for the past 2 years.
Sexuality is mentioned and that does include sex between man and woman, same sex partners and self pleasuring.

But there is a clear delineation between monks who have take their vows and lay people.
http://en.wikipedia.org/wiki/Buddhism_and_sexuality


  To lay people Buddha advised that they should at least avoid sexual
  misconduct which meant following generally accepted norms of sexual
  morality and behavior. From Buddha's full-time disciples, the ordained
  monks and nuns, strict celibacy (called brahmacarya) has always been
  required.


But what is the issue with sexuality. Shakyamuni Buddha had been married and surrounded by women before he was married, per his father the king's devices to keep Shakyamuni interested in assuming the throne after the king died.
So Buddha spoke from experience. What is he trying to tell us?


  In the Buddha's first discourse he identifies craving (tanha) as the
  cause of suffering (dukkha). He then identifies three objects of
  craving: the craving for existence; the craving for non-existence and
  the craving for sense pleasures (kama). Kama is identified as one of
  five hindrances to the attainment of jhana according to the Buddha's
  teaching. Throughout the Sutta Pitaka Buddha often compares sexual
  pleasure to arrows or darts. So in the Kama Sutta from the Sutta
  Nipata Buddha explains that craving sexual pleasure is a cause of
  suffering. —Kama Sutta, Sutta Nipata[1]


So really the issue is not sex or no sex, but what to do with craving. As lay people, a long term relationship is one way of expressing these cravings, but even so sex is not the answer to our deepest longing to awaken to Buddha consciousness.

Buddha goes on to explain in greater detail what is the problem.


  If one, longing for sexual pleasure, achieves it, yes, he's enraptured
  at heart. The mortal gets what he wants. But if for that person —
  longing, desiring — the pleasures diminish, he's shattered, as if shot
  with an arrow.
  —Kama Sutta, Sutta Nipata[1]


So the aspirant is shot with the arrow of disappointment. But this disappointment can be a prod to try harder to see beyond the lie that sensual satisfaction will really give lasting fulfillment. It isn't a matter of whether the rules say to do or not do sex, but what will this act do for my practice.

There is another post on onions and garlic and how those are best avoided. So there may be things one can do to lessen the craving. What was the motivation for the prohibition on eating onions and garlic?

Buddha then goes on to say:


  So one, always mindful, should avoid sexual desires. Letting them go,
  he will cross over the flood like one who, having bailed out the boat,
  has reached the far shore.
  
  The 'flood' refers to the deluge of human suffering. The 'far shore'
  is nibbana, a state in which there is no sexual desire.
  
  The meaning of the Kama Sutta is that sexual desire, like any habitual
  sense pleasure, brings suffering.


So that is the crux of the matter "any habitual sense pleasure, brings suffering."

So that gets us back to the Four Noble truths. And now we are in the heart of Buddhism, finding a way out of suffering.