manpage: lua: fix typo paramater -> parameter
audio: fix busy loop when seeking while paused

When playing paused, the amount of decoded audio is limited to a small
amount (1 sample), because we don't write any audio to the AO when
paused. The small amount could trigger the case of the wanted audio
being too far in the future in the PTS sync code, which set the audio
status to STATUS_DRAINING, which in turn triggered the EOF code in the
next iteration. This was ok, but unfortunately, this triggered another
retry in order to check resuming from EOF by setting the status to
STATUS_SYNCING, which in turn lead to the busy loop by alternating
between the 2 states. So don't try resyncing while paused.

Since the PTS syncing code also calls ao_reset(), this could cause the
pulseaudio daemon to consume some CPU time as well.

This was caused by commit 33b57f55. Before that, the playloop was merely
run more often, but didn't cause any problems.

Fixes #1288.
audio: alternative fix for previous commit

This is a somewhat obscure situation, and happens only if audio starts
again after it has ended (in particular can happens with files where
audio starts later). It doesn't matter much whether audio starts
immediately or some milliseconds later, so simplify it.
demux_mkv: fix a possible out of bounds access

The if branch has a weak check to test whether the codec_id is the short
ID, and handles the long IDs in the else branch. The long IDs are all
longer than 12 bytes long, so hardcoding the string offset to get the
trailing part of the name makes sense. But the if condition checks for
another thing, which could get the else branch run even if the codec_id
is short.

Fix the bogus control flow and check if the codec_id is long enough. One
of these checks could be considered redundant, but include them both for
defensive coding.
subprocess-win: remove a Vista-only flag

PIPE_REJECT_REMOTE_CLIENTS isn't supported on XP. It's not really
needed, so remove it. Also fix error checking for CreateNamedPipe.
build: fix typos

thanks to @Nikoli
win32: add screen offset when handling overlarge windows

MS Windows doesn't allow windows larger than the screen, so we include
a hack to make the window smaller. This hack recenters the window (what
else would it do?).

It didn't account for the virtual offset of the current screen, and it
was reported that it forces the window to the first screen.

Should fix #1292.
demux_playlist: don't ignore last line in m3u

If EOF is reached after reading a line, the EOF flag is set. This was a
problem for the m3u code, which checked for EOF _after_ reading a line,
which will discard the last line read.

Also fix a typo in an unrelated part of the file.
vd_lavc: don't crash if codec could not be opened

Fixes #1307.
audio: allow more than 20 channel map entries

This could trigger an assertion when using ao_alsa or ao_coreaudio. The
code was simply assuming the number of channel maps was bounded
statically (which was true at first in both AOs).

Fix by using dynamic memory allocation. It needs to be explicitly
enabled by the AOs by setting a temp context, because otherwise the
memory couldn't be freed. (Or at least this seems to be the most elegant
solution.)

Fixes #1306.
audio: fix one of the previous commits

Fixes commit 52c51149. It broke multichannel (or possibly everything)
for ao_alsa, ao_oss, ao_sndio.