mathops/x86: work around inline asm miscompilation with GCC 4.8.1

The volatile is not required here, and prevents a miscompilation with GCC
4.8.1 when building on x86 with --cpu=i686

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
omadec: Properly check lengths before incrementing the position

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
sierravmd: Do sanity checking of frame sizes

Limit the size to INT_MAX/2 (for simplicity) to be sure that
size + BYTES_PER_FRAME_RECORD won't overflow.

Also factorize other existing error return paths.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
vocdec: Don't update codec parameters mid-stream

If we really want to support parameter changes, they need to be
signalled along with the AVPackets as parameter change side data,
not just changing the AVCodecContext parameters when a packet
is demuxed (since there may be other earlier packets yet undecoded).

Something similar was already done for the sample rate in 0883109b2,
but some parameters were left changeable.

This avoids having to recheck the channel count for validity for
each decoded frame in (ad)pcm decoders, unless the decoders
explicitly say that they accept parameter changes.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
cavsdec: Make sure a sequence header has been decoded before decoding pictures

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
proresdec: Properly make sure an index doesn't run past the limit

If idx equaled num_coeffs - 1 on entry to the loop, the previous
check failed to break out of the loop.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
vp3: Check the framerate for validity

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
avpacket: Fix error checking in packet_alloc

Previously the wrong buffer pointer was checked, when buf
instead of *buf was checked. But checking the return value
instead is even better.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
Fix references to deleted avcodec_encode_video() function
mem: Introduce av_reallocp
rtmp: Factor out publish specific code

Will be reused for supporting play.
rtmp: Support play method in listen mode
rtmp: Drop an unneeded warning

Apparently a widely used streaming server requires that the second
field always presents a version during C1 phase.
rtmp: Do not send the first field twice within the handshake
rtmp: Store all the notify messages

The onTextData is used to implement text data streams in flv.
flv: Do not export datastream as metadata

It is used internally.
lavf: Add a flag to enable/disable per-packet flushing

This is enabled by default and can be disabled with
"-fflags -flush_packets".

Inspired by a patch from Nicolas George <nicolas.george@normalesup.org>.

Signed-off-by: Martin Storsjö <martin@martin.st>
lavf: Don't explicitly flush after each written packet in muxers

Since 596e5d4783, this is not necessary anymore. It also allows to
actually disable the flushing, improving write performance (but
possibly giving worse latency in real-time streaming).

Signed-off-by: Martin Storsjö <martin@martin.st>
x86: Add an xmm clobbering wrapper for avcodec_encode_video2

This is required since 187105ff8 when we started trying to
wrap this function as well.

Signed-off-by: Martin Storsjö <martin@martin.st>
lavf: Make probe_codec return an error code

This allows handling errors from av_realloc properly.

Signed-off-by: Martin Storsjö <martin@martin.st>