ffmpeg/libavformat
Luca Barbato d9ae1031f5 lavf: improve handling of sparse streams when muxing
Currently ff_interleave_packet_per_dts() waits until it gets a frame for
each stream before outputting packets in interleaved order.

Sparse streams (i.e. streams with much fewer packets than the other
streams, like subtitles or audio with DTX) tend to add up latency and in
specific cases end up allocating a large amount of memory.

Emit the top packet from the packet_buffer if it has a time delta
larger than a specified threshold.

Original report of the issue and initial proposed solution by
mus.svz@gmail.com.

Bug-id: 31
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-02-04 22:01:42 +01:00
..
4xm.c 4xm: Check that the read track value is non-negative 2013-09-03 22:57:36 +03:00
Makefile configure: Prefix libc-related variables with "libc_" 2013-12-09 11:47:43 +01:00
a64.c
aacdec.c
ac3dec.c
adtsenc.c lavf: Don't explicitly flush after each written packet in muxers 2013-09-16 22:17:33 +03:00
adxdec.c
aea.c
aiff.h
aiffdec.c
aiffenc.c Add missing #includes for *INT64_MAX and *INT64_C 2013-11-23 21:55:52 +01:00
allformats.c Add an HDS live fragmenting muxer 2013-11-02 10:51:00 +02:00
amr.c lavf: Don't explicitly flush after each written packet in muxers 2013-09-16 22:17:33 +03:00
anm.c
apc.c
ape.c ape: Don't allow the seektable to be omitted 2013-09-12 10:53:25 +03:00
apetag.c apetag: use int64_t for filesize 2013-06-04 17:20:19 +02:00
apetag.h apetag: add support for writing APE tags 2013-05-28 18:19:03 +02:00
asf.c asfenc: add ASF_Reserved_4 as defined in section 10.10 of the ASF spec 2013-09-19 19:37:46 +02:00
asf.h asfenc: remember send time and offset of the index entries 2013-09-19 19:37:59 +02:00
asfcrypt.c
asfcrypt.h
asfdec.c asfdec: Check the return value of asf_read_stream_properties 2013-09-30 10:48:58 +03:00
asfenc.c asfenc: mux chapters in ASF files using an ASF "marker" section 2013-09-19 19:51:49 +02:00
assdec.c Add missing #includes for *INT64_MAX and *INT64_C 2013-11-23 21:55:52 +01:00
assenc.c lavf: Don't explicitly flush after each written packet in muxers 2013-09-16 22:17:33 +03:00
au.c
audiointerleave.c
audiointerleave.h
avc.c
avc.h
avformat.h lavf: improve handling of sparse streams when muxing 2014-02-04 22:01:42 +01:00
avi.h
avidec.c Add missing #includes for *INT64_MAX and *INT64_C 2013-11-23 21:55:52 +01:00
avienc.c avienc: drop the vfr flag. 2013-11-08 21:02:29 +01:00
avio.c lavf: Remove a now useless parameter to ffurl_register_protocol 2013-10-30 09:53:48 +02:00
avio.h
avio_internal.h aviobuf: Add functions for null buffers 2013-09-19 22:42:37 +03:00
aviobuf.c aviobuf: Handle a NULL buffer in avio_close_dyn_buf 2013-11-01 09:56:27 +02:00
avisynth.c avisynth: fix setting packet properties 2014-01-17 11:11:08 +01:00
avlanguage.c
avlanguage.h
avs.c
bethsoftvid.c
bfi.c bfi: Add some very basic sanity checks for input packet sizes 2013-09-29 19:59:32 +03:00
bink.c
bmv.c bmv: Remove unused variable 2013-10-06 19:36:53 +02:00
c93.c
caf.c
caf.h
cafdec.c
cavsvideodec.c
cdg.c
cdxl.c
concat.c lavf: Allocate arrays with av_realloc if they will be realloced later 2013-09-26 23:13:53 +03:00
crcenc.c
crypto.c
cutils.c
daud.c lavf: Don't explicitly flush after each written packet in muxers 2013-09-16 22:17:33 +03:00
dfa.c
diracdec.c
dnxhddec.c
dsicin.c dsicin: Add some basic sanity checks for fields read from the file 2013-09-11 20:18:55 +03:00
dtsdec.c
dv.c dv: Split DV data table declarations into their own header 2013-11-15 01:29:47 +01:00
dv.h
dvenc.c dv: Split DV data table declarations into their own header 2013-11-15 01:29:47 +01:00
dxa.c
eacdata.c
electronicarts.c electronicarts: Add more sanity checking for the number of channels 2013-09-29 19:58:41 +03:00
ffm.h
ffmdec.c Add missing #includes for *INT64_MAX and *INT64_C 2013-11-23 21:55:52 +01:00
ffmenc.c
ffmeta.h
ffmetadec.c
ffmetaenc.c
file.c libavformat: use avpriv_open() 2013-08-07 21:22:03 +02:00
file_open.c libavutil: Make avpriv_open a library-internal function on msvcrt 2013-08-10 00:53:33 +03:00
filmstripdec.c
filmstripenc.c
flac_picture.c flac: move picture parsing code in a separate file 2013-10-12 15:30:39 +02:00
flac_picture.h flac: move picture parsing code in a separate file 2013-10-12 15:30:39 +02:00
flacdec.c flac: move picture parsing code in a separate file 2013-10-12 15:30:39 +02:00
flacenc.c flac muxer: add option to disable writing the global header 2014-01-09 16:09:41 -05:00
flacenc.h
flacenc_header.c
flic.c
flv.h
flvdec.c flv: Workaround for buggy Omnia A/XE encoder 2014-01-11 13:14:20 +01:00
flvenc.c flv: Use the correct type to hold the file offset 2013-12-20 17:44:20 +01:00
format.c avf: split off format register and lookup function 2013-06-16 14:00:40 +02:00
framecrcenc.c lavf: Don't explicitly flush after each written packet in muxers 2013-09-16 22:17:33 +03:00
framehash.c
g722.c
g723_1.c
gif.c lavf: Don't explicitly flush after each written packet in muxers 2013-09-16 22:17:33 +03:00
gopher.c
gsmdec.c
gxf.c
gxf.h
gxfenc.c lavf: Don't explicitly flush after each written packet in muxers 2013-09-16 22:17:33 +03:00
h261dec.c
h263dec.c
h264dec.c h264dec: Add .avc file name extension 2013-09-20 21:08:02 +02:00
hdsenc.c hdsenc: Check the init_file() return code 2013-12-14 17:48:46 +02:00
hevcdec.c Add raw HEVC demuxer 2013-10-31 20:20:24 +01:00
hls.c hls: Avoid reading outside of the allocated array 2013-11-22 14:27:10 +02:00
hlsenc.c Add missing #includes for *INT64_MAX and *INT64_C 2013-11-23 21:55:52 +01:00
hlsproto.c hlsproto: Store all durations in AV_TIME_BASE 2013-07-29 20:15:50 +03:00
hnm.c HNM4/HNM4A demuxer & video decoder 2013-10-31 17:45:46 +01:00
http.c http: Expose the content location via an AVOption 2013-11-22 14:27:07 +02:00
http.h
httpauth.c
httpauth.h
id3v1.c
id3v1.h
id3v2.c
id3v2.h
id3v2enc.c
idcin.c
idroqdec.c idroqdec: Make sure a video stream has been allocated before returning packets 2013-09-19 11:09:04 +03:00
idroqenc.c
iff.c
ilbc.c lavf: Don't explicitly flush after each written packet in muxers 2013-09-16 22:17:33 +03:00
img2.c img2: add stereo 3d still picture file extensions 2013-12-12 16:10:15 +01:00
img2dec.c
img2enc.c Add a libwebp encoder 2013-12-21 17:01:42 -05:00
ingenientdec.c
internal.h lavf: ignore attachment streams for interleaving purposes 2014-02-04 11:17:06 +01:00
ipmovie.c
isom.c lavf: improve support for AVC-Intra files. 2013-11-14 18:59:39 +01:00
isom.h lavf: improve support for AVC-Intra files. 2013-11-14 18:59:39 +01:00
iss.c
iv8.c
ivfdec.c
ivfenc.c lavf: Don't explicitly flush after each written packet in muxers 2013-09-16 22:17:33 +03:00
jvdec.c jvdec: K&R formatting cosmetics 2014-02-04 12:35:38 +01:00
latmenc.c
libavformat.v
librtmp.c
lmlm4.c
log2_tab.c
lxfdec.c lxf: check the nb_streams instead of relying on padding 2013-09-27 01:33:46 +02:00
m4vdec.c
matroska.c matroskadec: Support HEVC demuxing 2013-10-31 20:20:49 +01:00
matroska.h matroskadec: silently skip CodecState element. 2013-05-27 21:25:53 +02:00
matroskadec.c matroskadec: use correct compression parameters for current track CodecPrivate 2013-11-21 20:54:55 +01:00
matroskaenc.c Add missing #includes for *INT64_MAX and *INT64_C 2013-11-23 21:55:52 +01:00
md5enc.c
md5proto.c
metadata-example.c
metadata.c
metadata.h
mm.c
mmf.c mmf: Write metadata into an Optional Data chunk 2013-05-14 17:14:38 +02:00
mms.c mms: Remove non-utf8 characters 2013-12-26 06:07:35 +01:00
mms.h
mmsh.c
mmst.c mms: Remove non-utf8 characters 2013-12-26 06:07:35 +01:00
mov.c mov: do not set avg_frame_rate in the demuxer 2014-01-20 19:15:36 +00:00
mov_chan.c
mov_chan.h
movenc.c Add missing #includes for *INT64_MAX and *INT64_C 2013-11-23 21:55:52 +01:00
movenc.h movenc: Add an F4V muxer 2013-10-23 11:17:03 +03:00
movenchint.c movenchint: Clear size and len if the realloc failed 2013-09-22 21:02:52 +03:00
mp3dec.c mp3: add .mpa extension 2013-09-12 13:16:15 +02:00
mp3enc.c mp3enc: allow omitting the id3v2 header with -id3v2_version 0 2014-01-17 10:30:45 +01:00
mpc.c
mpc8.c mpc8: Make sure the first stream exists before parsing the seek table 2013-09-12 10:54:27 +03:00
mpeg.c pcm_dvd: consolidate pieces from pcm.c and mpeg.c 2013-08-31 11:26:29 +02:00
mpeg.h
mpegenc.c Add missing #includes for *INT64_MAX and *INT64_C 2013-11-23 21:55:52 +01:00
mpegts.c mpegts: add HEVC registration descriptor 2013-12-12 16:10:15 +01:00
mpegts.h
mpegtsenc.c
mpegvideodec.c
mpjpeg.c lavf: Don't explicitly flush after each written packet in muxers 2013-09-16 22:17:33 +03:00
msnwc_tcp.c
mtv.c
mux.c lavf: improve handling of sparse streams when muxing 2014-02-04 22:01:42 +01:00
mvi.c mvi: Add sanity checking for the audio frame size 2013-09-29 19:57:43 +03:00
mxf.c
mxf.h
mxfdec.c mxf: Read field dominance flag 2014-02-01 16:26:44 +01:00
mxfenc.c mxfenc: switch to av_reallocp_array() and check allocation errors 2013-08-04 16:49:04 +02:00
mxg.c Disable deprecation warnings for cases where a replacement is available 2013-08-02 19:19:02 +02:00
ncdec.c
network.c ff_socket: put out-of-line and fallback to fcntl() for close-on-exec 2013-08-09 11:26:50 +03:00
network.h network.h: Add #endif comments to improve readability 2014-01-06 21:16:54 +01:00
noproxy-test.c avf: move ff_http_match_no_proxy to network 2013-06-16 14:41:00 +02:00
nsvdec.c nsvdec: Remove commented-out debug cruft 2013-06-02 18:11:58 +02:00
nullenc.c
nut.c nut: Fix unchecked allocations 2013-10-22 17:09:56 +01:00
nut.h nut: Fix unchecked allocations 2013-10-22 17:09:56 +01:00
nutdec.c nut: Fix unchecked allocations 2013-10-22 17:09:56 +01:00
nutenc.c Add missing #includes for *INT64_MAX and *INT64_C 2013-11-23 21:55:52 +01:00
nuv.c
oggdec.c oggdec: add support for Opus in Ogg demuxing 2013-10-12 15:25:18 +02:00
oggdec.h oggdec: add support for Opus in Ogg demuxing 2013-10-12 15:25:18 +02:00
oggenc.c Add missing #includes for *INT64_MAX and *INT64_C 2013-11-23 21:55:52 +01:00
oggparsecelt.c
oggparsedirac.c
oggparseflac.c
oggparseogm.c oggparseogm: check timing variables 2014-01-06 08:21:38 +01:00
oggparseopus.c oggdec: add support for Opus in Ogg demuxing 2013-10-12 15:25:18 +02:00
oggparseskeleton.c
oggparsespeex.c
oggparsetheora.c oggparsetheora: stop using deprecated avcodec_set_dimensions 2013-10-31 20:14:14 +01:00
oggparsevorbis.c oggparsevorbis: fail on memory allocation error 2013-10-12 15:37:56 +02:00
oma.c Add support for multichannel ATRAC3+ streams. 2013-09-29 21:52:57 +02:00
oma.h Add support for multichannel ATRAC3+ streams. 2013-09-29 21:52:57 +02:00
omadec.c ATRAC3+ decoder 2014-01-09 19:33:07 +01:00
omaenc.c
options.c lavf: ignore attachment streams for interleaving purposes 2014-02-04 11:17:06 +01:00
options_table.h lavf: improve handling of sparse streams when muxing 2014-02-04 22:01:42 +01:00
os_support.c os_support: Add #endif comments for better readability 2013-11-02 13:57:03 +01:00
os_support.h file: Move win32 utf8->wchar open wrapper to libavutil 2013-08-08 16:41:33 +03:00
pcm.c
pcm.h
pcmdec.c
pcmenc.c
pmpdec.c pmpdec: check that there is at least one audio packet. 2014-01-03 16:40:22 +01:00
psxstr.c Disable deprecation warnings for cases where a replacement is available 2013-08-02 19:19:02 +02:00
pva.c
qcp.c
qtpalette.h
r3d.c r3d: Add more input value validation 2013-09-19 22:47:26 +03:00
rawdec.c
rawdec.h
rawenc.c lavf: Don't explicitly flush after each written packet in muxers 2013-09-16 22:17:33 +03:00
rawenc.h
rawvideodec.c
rdt.c lavf: do not export av_register_{rtp,rdt}_dynamic_payload_handlers from shared objects 2013-10-28 15:29:49 +01:00
rdt.h lavf: do not export av_register_{rtp,rdt}_dynamic_payload_handlers from shared objects 2013-10-28 15:29:49 +01:00
riff.c MSN Audio support 2013-11-26 08:31:10 +01:00
riff.h riff.h: Remove stray extern declaration for non-existing symbol 2013-08-05 22:44:48 +02:00
riffdec.c riffdec: Add sanity checks for the sample rate 2013-09-29 19:58:18 +03:00
riffenc.c riff: Move muxing code to a separate file 2013-08-06 11:02:35 +02:00
rl2.c Add missing #includes for *INT64_MAX and *INT64_C 2013-11-23 21:55:52 +01:00
rm.c
rm.h
rmdec.c rmdec: Validate the fps value 2013-09-18 11:30:06 +03:00
rmenc.c lavf: Don't explicitly flush after each written packet in muxers 2013-09-16 22:17:33 +03:00
rmsipr.c
rmsipr.h
rpl.c Add missing #includes for *INT64_MAX and *INT64_C 2013-11-23 21:55:52 +01:00
rso.c
rso.h
rsodec.c
rsoenc.c
rtmp.h use my full first name instead of short one in copyrights 2013-06-01 13:38:50 +02:00
rtmpcrypt.c
rtmpcrypt.h
rtmpdh.c
rtmpdh.h
rtmphttp.c rtmphttp: Check for both 0 and AVERROR_EOF 2013-11-18 12:36:32 +02:00
rtmppkt.c rtmpproto: Send a full, absolute timestamp if it isn't monotonically growing 2014-01-20 21:57:02 +02:00
rtmppkt.h rtmp: Allocate the prev_pkt arrays dynamically 2013-10-14 14:27:35 +03:00
rtmpproto.c rtmpproto: Avoid using uninitialized memory 2014-01-20 21:56:57 +02:00
rtp.c
rtp.h rtpenc: Simplify code by introducing a macro for rescaling NTP timestamps 2013-07-31 21:12:34 +03:00
rtpdec.c lavf: do not export av_register_{rtp,rdt}_dynamic_payload_handlers from shared objects 2013-10-28 15:29:49 +01:00
rtpdec.h lavf: do not export av_register_{rtp,rdt}_dynamic_payload_handlers from shared objects 2013-10-28 15:29:49 +01:00
rtpdec_amr.c
rtpdec_asf.c rtpdec_asf: Copy the need_parsing field from the chained demuxer 2014-01-23 17:37:10 +02:00
rtpdec_formats.h
rtpdec_g726.c
rtpdec_h263.c
rtpdec_h263_rfc2190.c
rtpdec_h264.c rtpdec_h264: Check the return value of functions doing allocations 2013-12-14 17:48:46 +02:00
rtpdec_ilbc.c
rtpdec_jpeg.c
rtpdec_latm.c
rtpdec_mpeg4.c
rtpdec_mpeg12.c
rtpdec_mpegts.c
rtpdec_qcelp.c
rtpdec_qdm2.c
rtpdec_qt.c lavf: Reset the entry count and allocation size variables on av_reallocp failures 2013-09-26 23:14:03 +03:00
rtpdec_svq3.c
rtpdec_vp8.c
rtpdec_xiph.c
rtpenc.c rtpenc: Add a rtpflag option for sending BYE packets when finishing 2013-11-01 09:57:02 +02:00
rtpenc.h rtpenc: Add a rtpflag option for sending BYE packets when finishing 2013-11-01 09:57:02 +02:00
rtpenc_aac.c
rtpenc_amr.c
rtpenc_chain.c rtpenc_chain: Check for errors from ffio_fdopen and ffio_open_dyn_packet_buf 2013-08-07 11:37:13 +03:00
rtpenc_chain.h
rtpenc_h263.c
rtpenc_h263_rfc2190.c
rtpenc_h264.c
rtpenc_jpeg.c
rtpenc_latm.c
rtpenc_mpv.c
rtpenc_vp8.c
rtpenc_xiph.c
rtpproto.c rtpproto: Check the right feature detection macro 2013-08-15 15:35:41 +03:00
rtpproto.h rtpproto: Move rtpproto specific function declarations to a separate header 2013-07-31 21:12:34 +03:00
rtsp.c rtsp: suppress a incompatible pointer types warning 2013-12-12 16:10:14 +01:00
rtsp.h rtspenc: Make sure BYE packets are sent before TEARDOWN 2013-11-01 09:57:06 +02:00
rtspcodes.h
rtspdec.c rtspdec: Fix keep-alive request for ACTi cameras 2013-12-11 22:48:55 +02:00
rtspenc.c rtspenc: Make sure BYE packets are sent before TEARDOWN 2013-11-01 09:57:06 +02:00
sapdec.c
sapenc.c
sauce.c
sauce.h
sctp.c network: Use SOCK_CLOEXEC when available 2013-08-05 16:13:36 +02:00
sdp.c sdp: Check that fmt->oformat is non-null before accessing it 2014-01-05 01:33:46 +02:00
seek-test.c
seek.c Add missing #includes for *INT64_MAX and *INT64_C 2013-11-23 21:55:52 +01:00
seek.h lavf: remove unreliable timestamp guessing heuristic 2013-10-28 09:28:19 +01:00
segafilm.c segafilm: fix leaks if reading the header fails 2014-01-06 08:26:09 +01:00
segment.c
sierravmd.c sierravmd: Do sanity checking of frame sizes 2013-09-16 11:04:52 +03:00
siff.c
smacker.c lavf: Reset the entry count and allocation size variables on av_reallocp failures 2013-09-26 23:14:03 +03:00
smjpeg.c
smjpeg.h
smjpegdec.c
smjpegenc.c lavf: Don't explicitly flush after each written packet in muxers 2013-09-16 22:17:33 +03:00
smoothstreamingenc.c lavf: Reset the entry count and allocation size variables on av_reallocp failures 2013-09-26 23:14:03 +03:00
sol.c
sox.h
soxdec.c
soxenc.c
spdif.c
spdif.h cosmetics: Fix ATRAC codec name spelling 2013-09-02 21:38:57 +02:00
spdifdec.c
spdifenc.c lavf: Don't explicitly flush after each written packet in muxers 2013-09-16 22:17:33 +03:00
srtdec.c
srtp.c
srtp.h
srtpproto.c
swf.c
swf.h
swfdec.c
swfenc.c lavf: Don't explicitly flush after each written packet in muxers 2013-09-16 22:17:33 +03:00
takdec.c
tcp.c tcp: Explicitly convert a pointer to a boolean integer 2013-09-09 23:57:04 +03:00
thp.c
tiertexseq.c
tls.c tls: Add support for listen mode 2013-09-26 23:13:35 +03:00
tmv.c
tta.c
tty.c
txd.c
udp.c network: Use SOCK_CLOEXEC when available 2013-08-05 16:13:36 +02:00
unix.c tcp: Use a different log message and level if there's more addresses to try 2013-08-06 10:39:39 +03:00
url-test.c avf: move url utility functions in a separate file 2013-06-16 15:01:39 +02:00
url.c avf: move url utility functions in a separate file 2013-06-16 15:01:39 +02:00
url.h lavf: Remove a now useless parameter to ffurl_register_protocol 2013-10-30 09:53:48 +02:00
urldecode.c
urldecode.h
utils.c lavf: ignore attachment streams for interleaving purposes 2014-02-04 11:17:06 +01:00
vc1test.c
vc1testenc.c lavf: Don't explicitly flush after each written packet in muxers 2013-09-16 22:17:33 +03:00
version.h lavf: improve handling of sparse streams when muxing 2014-02-04 22:01:42 +01:00
voc.c
voc.h
vocdec.c vocdec: Don't update codec parameters mid-stream 2013-09-16 11:04:52 +03:00
vocenc.c
vorbiscomment.c
vorbiscomment.h
vqf.c vqf: Make sure the bitrate is in the valid range 2013-09-29 18:46:39 +03:00
wavdec.c Add missing #includes for *INT64_MAX and *INT64_C 2013-11-23 21:55:52 +01:00
wavenc.c
wc3movie.c
westwood_aud.c
westwood_vqa.c westwood_vqa: do not free extradata on error in read_header 2013-07-07 22:04:43 +02:00
wtv.c wtv: fix variable sign in format 2013-11-03 11:51:40 +01:00
wv.c wvdec: split block header parsing into a separate file 2013-05-28 17:47:59 +02:00
wv.h wvdec: split block header parsing into a separate file 2013-05-28 17:47:59 +02:00
wvdec.c wvdec: split block header parsing into a separate file 2013-05-28 17:47:59 +02:00
wvenc.c lavf: Don't explicitly flush after each written packet in muxers 2013-09-16 22:17:33 +03:00
xa.c
xmv.c xmv: Add more sanity checks for parameters read from the bitstream 2013-09-17 20:09:25 +03:00
xwma.c Add missing #includes for *INT64_MAX and *INT64_C 2013-11-23 21:55:52 +01:00
yop.c yop: Clear all references to the AVBuffer in the local AVPacket 2013-09-19 22:46:21 +03:00
yuv4mpeg.c yuv4mpeg: set average frame rate 2014-01-17 10:30:45 +01:00