manpage: fix a typo
audio: remove unnecessary code

It's true that the decoder can successfully decode, but return no data
(for various reasons). We don't need to handle this specially, though.
We just let the decoder decode some more data. This doesn't increase the
danger of an endless loop either, because audio_decode() already calls
this function until enough is decoded.
audio: cosmetics

Move a function call, which does not change semantics.

Write the extra buffer sample count in a more straight-forward way; the
old code was not meaningful in any way (anymore).
audio: fix race condition in EOF code

Don't return an EOF code if there's still buffered data.

Also, don't call demux_stream_eof() in the playloop. There's probably
nothing wrong with it, but it's cleaner not to use it.

Also give AD_EOF its own value, so that a decoding error doesn't drain
audio by causing an EOF condition.
audio: adjust format change code

Execute the format change based on whether we logically detected EOF
(after filters), instead of when the decode buffer was drained. It's
slightly cleaner. (The requirement of len>0 existed before.)
audio: fix timestamps

Accidentally broken in b6af44d3. For ad_lavc (and in general), the PTS
was not updated correctly when filtering only parts of audio frames,
and for ad_mpg123 and ad_spdif the PTS was additionally offset by the
frame size.

This could lead to incorrect time display, and possibly broken A/V sync.
audio: cosmetics: collapse a function

There's no need for build_afilter_chain() to be a separate function
anymore.