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>
This commit is contained in:
Luca Barbato
2014-01-20 13:28:37 +01:00
committed by Anton Khirnov
parent 4c3e1956ee
commit d9ae1031f5
5 changed files with 59 additions and 4 deletions

View File

@@ -13,6 +13,10 @@ libavutil: 2013-12-xx
API changes, most recent first:
2014-02-xx - xxxxxxx - lavf 55.11.0 - avformat.h
Add AVFormatContext.max_interleave_delta for controlling amount of buffering
when interleaving.
2014-01-xx - xxxxxxx - lavc 55.32.1 - avcodec.h
Edges are not required anymore on video buffers allocated by get_buffer2()
(i.e. as if the CODEC_FLAG_EMU_EDGE flag was always on). Deprecate