rtmp: Support AMF_DATA_TYPE_MIXEDARRAY

And fix the AMF_DATA_TYPE_ARRAY parsing while at it.

A MIXEDARRAY type, as the ARRAY, store the number of elements in
an uint32 before the list. The ARRAY is strict and does not have
an OBJECT terminator, MIXEDARRAY behaves like an OBJECT type and
a different than stated number of element can be present.
rtmp: Refactor get_packet
rtmp: Rewrite embedded flv handling

Use update_offset() as done for rtmp audio, video and notifications and
read update and write the fields instead of replacing them in the rtmp
packet and then memcpying it to the output buffer.
rtmp: Replace a magic number with a macro

11 is the RTMP header size.
flv: Make onTextData parsing robust

Certain streaming servers do not preserve the order of the fields.
avformat/movenchint: revert "Use av_reallocp() where suitable"

reverts movenchin part of 5626f994f273af80fb100d4743b963304de9e05c
The change left the fields in an inconsistent state

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/movenchint: only change queue size if reallocation succeeded

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/movenchint: use realloc_array() to protect against integer overflow

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tls: Do not abort on non-fatal TLS alerts with gnutls

Signed-off-by: Martin Storsjö <martin@martin.st>
movenc: Set mov->mode earlier in mov_write_header

This allows simplifying some early checks that depend on the
muxer mode.

Signed-off-by: Martin Storsjö <martin@martin.st>
movenc: Set all implicit flags immediately in mov_write_header

This makes sure other sanity checks for conflicting options
can work properly, e.g. for the conflict between the faststart
flag when using the ismv mode.

Signed-off-by: Martin Storsjö <martin@martin.st>
movenc: Use keyframes as default fragmentation point in ismv

Fragmenting blindly to a certain duration isn't a good choice
if one should be able to switch between different qualities,
therefore default to keyframes instead.

Signed-off-by: Martin Storsjö <martin@martin.st>
wnv1: Make sure the input packet is large enough

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
vc1dec: Fix leaks in ff_vc1_decode_init_alloc_tables on errors

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
Fix nonsense MPEG-4 hwaccel code.

Issues with the code:
1) The skip_bits_long breaks packed B-frames since we skip
of the packed frame, even for VDPAU.
2) Calling ff_h263_find_resync_marker_reverse is nonsense for MPEG-4,
and for H.263 the only code using this (vaapi_mpeg4) explicitly reverts
this change!
3) mb_x/mb_y are always 0 when vaapi_mpeg4_decode_slice, so doing
computations with them is just obfuscation
4) due to not updating mb_y the code would always go into the error
resilience case, causing nonsense error messages and maybe further
issues.

While tested to fix the data provided to the decoder in case of
VDPAU so it is the same as for the non-hwaccel code, the VA-API code
was not tested to still work, and adding regression testing even
as a quick hack is much more complicated for it.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
avformat/mov: reset extradata size when extradata gets deallocated due to realloc failure

This prevents the fields from becoming inconsistent

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Make decoding alpha optional for some codecs.

For codecs where decoding of a whole plane can simply
be skipped, we should offer applications to not decode
alpha for better performance (ca. 30% less CPU usage
and 40% reduced memory bandwidth).
It also means applications do not need to implement support
(even if it is rather simple) for YUVA formats in order to be
able to play these files.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
avfilter: add ladspa wrapper filter

Signed-off-by: Paul B Mahol <onemda@gmail.com>
avcodec/sgirledec: fix infinite loop in decode_sgirle8()

Fixes #2985.
Reported-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
lavc: Add support for interleaved chroma formats to libx264. Interleaved chroma is x264's native format

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>