From e1eb0fc960163402bbb4e630185790488f7d28ed Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Wed, 20 Apr 2016 23:10:37 +0300 Subject: movenc: Use packets in interleaving queues for the duration at the end of fragments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As long as caller only writes packets using av_interleaved_write_frame with no manual flushing, this should allow us to always have accurate durations at the end of fragments, since there should be at least one queued packet in each stream (except for the stream where the current packet is being written, but if the muxer itself does the cutting of fragments, it also has info about the next packet for that stream). Signed-off-by: Martin Storsjö --- libavformat/avformat.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libavformat/avformat.h') diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 7d026b66d5..fbdfba4fb1 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1720,6 +1720,10 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt); * increasing dts. Callers doing their own interleaving should call * av_write_frame() instead of this function. * + * Using this function instead of av_write_frame() can give muxers advance + * knowledge of future packets, improving e.g. the behaviour of the mp4 + * muxer for VFR content in fragmenting mode. + * * @param s media file handle * @param pkt The packet containing the data to be written. *
-- cgit v1.2.3