Make sure we don't buffer up more than max_delay worth of data
before writing a PES packet, even if pes_payload_size is set to
a larger value.
Signed-off-by: Martin Storsjö <martin@martin.st>
If opening and closing dynamic buffers as AVIOContext, we may
not have any AVIOContext available when wanting to close and
deallocate the muxer. Allow calling write_trailer despite this.
Signed-off-by: Martin Storsjö <martin@martin.st>
Prevent out of array writes.
Similar to what Michael Niedermayer did to address the same issue.
Bug-Id: CVE-2014-2263
CC: libav-stable@libav.org
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Previously, AVStream.codec.time_base was used for that purpose, which
was quite confusing for the callers. This change also opens the path for
removing AVStream.codec.
The change in the lavf-mkv test is due to the native timebase (1/1000)
being used instead of the default one (1/90000), so the packets are now
sent to the crc muxer in the same order in which they are demuxed
(previously some of them got reordered because of inexact timestamp
conversion).
Also move the declaration to internal.h, and add restrict qualifiers
to the declaration (as in the implementation).
Signed-off-by: Martin Storsjö <martin@martin.st>
This adds the avoption mpegts_flags and converts the existing
resend_headers option into a flag, keeping the old option as
fallback for now.
Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
This removes the dependency on adts.c internals, and simplifies
adding other packetization formats.
Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
Also add missing trailing commas, break long codec_tag lines and
add spaces in codec_tag declarations.
Signed-off-by: Martin Storsjö <martin@martin.st>
Make the muxers/demuxers that use the field handle the default
-1 in the same way as 0.
This allows distinguishing an intentionally set 0 from the default
value where the user hasn't set it.
Signed-off-by: Martin Storsjö <martin@martin.st>
When segmenting the output from the mpegts muxer, one can
now set this option when cutting to a new segment, to make sure
the next segment starts with PAT/PMT/SDT.
Signed-off-by: Martin Storsjö <martin@martin.st>
-vbsf doesn't exist anymore. It got renamed to -bsf somewhere along the
line. Update print statement accordingly.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
With the current default PES packet size, and very small audio bitrates,
audio packet duration gets too long. For players, which wait for a whole
audio packet (or more) it takes a very long time to start playing sound.
For 24kbps audio, one PES packet is about 1 second long. On Motorola STBs,
we observe about 3 second delay before the playback starts with the
default setting.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Do not assume the audio packets being always smaller than
DEFAULT_PES_PAYLOAD_SIZE.
Signed-off-by: Jindřich Makovička <makovick@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>