This MR changes es_format_t::i_extra from a signed int to size_t.
This variable is used to describe the size of the buffer pointed by
p_extra, and is never strictly negative.
Users of this member are also updated in this commit at once. I'm not
sure it's easy to split, except if callers are casted to size_t before
usage in a preparatory change, and then the cast is removed in a cleanup
change.
Some users were already using size_t though, like videotoolbox decoder
or hxxx_helpers.c. The main blocker for splitting is that most clients
not doing that are actually using pointers to i_extra instead of using a
copy, which is much more verbose to fix locally.
Almost No unneeded cast is added to fix signedness mismatch in this
patch. Most notably, only mpeg/ts_psi.c gets a new cast when using
__MIN() with fmt->i_extra, since the dvbpsi_descriptor_t::i_length
parameter is signed.
avformat/demux.c gets a temporary cast which is no-op with a version
libavutil >= 57 but which would trigger the warning before that. It may
be removed when libavutil < 57 is dropped.
This patch uses the information passed by the demuxer in block_t's
i_nb_samples and i_length to properly handle pre-skip, seeking
pre-roll, and end-trim. Multi-channel decoding should work. It also
adds .opus to the list of supported formats.
Signed-off-by: Rafaël Carré <funman@videolan.org>