lavf: Only initialize s->offset once when using avoid_negative_ts make_zero

When given a stream starting at dts=0, it would previously consider
s->offset as uninitialized and set an offset when the second packet
was written, ending up writing two packets with dts=0. By initializing
this field to AV_NOPTS_VALUE, we make sure that we only initialize it
once, on the first packet.

Signed-off-by: Martin Storsjö <martin@martin.st>
librtmp: append the correct field to the string

Also prevent a NULL pointer dereference.

CC: libav-stable@libav.org
Bug-Id: CID 1250329 / CID 1250331
libvpxenc: clean memory on error

CC: libav-stable@libav.org
Bug-Id: CID 733795
lavc: fix bitshifts amount bigger than the type

CC: libav-stable@libav.org
Bug-Id: CID 1194387 / CID 1194389 / CID 1194393 / CID 1206638
mov: check ff_get_wav_header() return value

CC: libav-stable@libav.org
Bug-Id: CID 717497
configure: Fix enabling memalign_hack automatically

simd_align_16 is a configure item that can be enabled or disabled,
it's not a variable containing a list of other configure items
as need_memalign previously. This was broken in eba2233b5.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
hdsenc: Use the right filename in an error message

Signed-off-by: Martin Storsjö <martin@martin.st>
hdsenc: Clear the previous codec tag when setting up the chained muxer

The chained flv muxer wants one set of tags - normally this set
could be signaled via the AVOutputFormat codec_tag field (as
smoothstreamingenc and dashenc do). hdsenc doesn't signal it, since
the FLV codec tag arrays aren't exported from flvenc.c. This can
lead to the caller keeping an original codec tag from the originating
container here, which would then be a mismatch for the FLV muxer.
Since we don't really care about what codec tag the caller might
have set, just clear it and let the lavf muxer layer set the right
one for the chained FLV muxer later instead.

Signed-off-by: Martin Storsjö <martin@martin.st>
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>
dashenc: Don't segment all video streams when one stream gets a keyframe

This makes sure that segments actually start at a keyframe,
when one stream uses b-frames while another one doesn't.