Push lots of copy/paste code into a macro, and en passant squash two small bugs.
Push lots of copy/paste code into a macro, and en passant squash two small bugs.

Signed-off-by: Jean-Paul Saman <bd4d7d9bc94665d51ceed908a3dc86f2580333fa@m2x.nl>

rdp/npapi-vlc,chengsun/gtk-npapi-vlc,jamesbates/npapi-vlc,chengsun/gtk-npapi-vlc,rdp/npapi-vlc,rdp/npapi-vlc,modulexcite/npapi-vlc,chengsun/gtk-npapi-vlc,jamesbates/npapi-vlc,modulexcite/npapi-vlc,modulexcite/npapi-vlc,jamesbates/npapi-vlc,modulexcite/npapi-vlc,rdp/npapi-vlc