avformat/assdec: UTF-16 support

Use the UTF-16 BOM to detect UTF-16 encoding. Convert the file contents
to UTF-8 on the fly using FFTextReader, which acts as converting wrapper
around AVIOContext. It also can work on a static buffer, needed for
format probing. The FFTextReader wrapper now also takes care of skipping
the UTF-8 BOM.

Fix Ticket #3496.
avformat/srtdec: UTF-16 support
avformat/samidec: UTF-16 support

ff_smil_extract_next_chunk() is still used by RealText.
avformat/realtextdec: UTF-16 support

Also remove ff_smil_extract_next_chunk - this was the last user of it.
avformat/srtdec: speed up probing
lavd/v4l2: introduce enqueue_buffer()

Additionally, make sure a buffer gets enqueued again (even in error paths) after
it has been succesfully dequeued.

Tested-by: Dmitry Volyntsev <xeioexception@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>