]> git.sesse.net Git - ffmpeg/commit
movenc: Set the last packet duration based on the next packet when autoflushing
authorMartin Storsjö <martin@martin.st>
Mon, 9 Mar 2015 09:47:54 +0000 (11:47 +0200)
committerMartin Storsjö <martin@martin.st>
Thu, 19 Mar 2015 08:27:07 +0000 (10:27 +0200)
commitb81b0cc22b22413760423e239ea644c9afdbfa2d
treecb952185939cb654545aaafdaeffa9da265b0b7d
parent3041183677bda0a431b36e96a2c76617abaa8183
movenc: Set the last packet duration based on the next packet when autoflushing

When automatically flushing fragments based on set conditions
(fragmentation on keyframes, after some interval or byte size),
we already have the next packet for one stream - use this for setting
the duration of the last packet in the flushed fragment correctly.

This avoids having to adjust the timestamp of the first packet in
the new fragment since the last duration was unknown.

Unfortunately, this only works for automatic flushing (not for
caller-triggered flushing, like in the dash muxer), and only for the
one single track that triggered the flushing. The duration of the
last sample in all other tracks still is dependent on AVPacket
duration (or heuristics).

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/movenc.c