lavc: Move the libtwolame encoder registration to the list for external libraries

This makes sure the default behaviour of using the internal encoder
stays the same regardless if libtwolame is enabled or not (as for
any external library).

This fixes fate-lavf-mpg if libav is built with libtwolame enabled.

CC: libav-stable@libav.org
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
xwma: Do not leak on failure path

CC: libav-stable@libav.org
Bug-Id: CID 1087092
lavfi: clean memory on error in ADD_FORMAT()

CC: libav-stable@libav.org
Bug-Id: CID 1250334
libtwolame: prevent a NULL pointer dereference

CC: libav-stable@libav.org
Bug-Id: CID 1250330 / CID 1250335
dvdsubdec: Do not leak on failure path

CC: libav-stable@libav.org
Bug-Id: CID 1198262
vp9: Use the correct upper bound for seg_id

And use a macro to make apparent why the value.

Bug-Id: CID 1108595
qdm2: avoid integer overflow

CC: libav-stable@libav.org
Bug-Id: CID 700555
hevc: Spin the mv_mpv_mode calls in a stand alone function

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
flvenc: Remove an unused variable

Signed-off-by: Martin Storsjö <martin@martin.st>
lavf: Remove a redundant include of sys/stat.h

The same file already includes this header a few lines further
above.

Signed-off-by: Martin Storsjö <martin@martin.st>
dashenc: Don't require the stream bitrate to be known

Don't write any bitrate attribute if it isn't known. As long as one
doesn't want automatic bitrate switching, playback can work just
fine even if it isn't set.

If strict standard compliance is requested, this is still considered
an error, since the attribute is mandatory according to the spec.

Based on a patch by Rodger Combs.

Signed-off-by: Martin Storsjö <martin@martin.st>
movenc: Add a flag for indicating a discontinuous fragment

This allows creating a later mp4 fragment without sequentially
writing the earlier ones before.

Normally when writing a fragmented mp4 file sequentially, the
first timestamps of a fragment are adjusted to match the
end of the previous fragment, to make sure the timestamp is the
same, even if it is calculated as the sum of previous fragment
durations.

When writing an individual mp4 fragment discontinuously like this
(with potentially writing the earlier fragments separately later),
there's a risk of getting a gap in the timeline if the duration
field of the last packet in the previous fragment doesn't match up
with the start time of the next fragment.

Using this requires setting -avoid_negative_ts make_non_negative
(or -avoid_negative_ts 0).
movenc: Expose the fragment index as an avoption

This allows setting the right fragment number if doing
random-access writing of fragments.
dashenc: Test: Allow skipping writing some segments