summaryrefslogtreecommitdiff
path: root/libavformat/movenc.h
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2014-11-20 09:51:05 +0200
committerMartin Storsjö <martin@martin.st>2014-11-26 09:56:56 +0200
commitee37620b6ae4783cda637408422044b2d14a688c (patch)
treecbd31a430eb4ebcbbf7352f08842bc5fe58a1633 /libavformat/movenc.h
parentf20141d73f08ed0c8e875bd993a7143e19b266e3 (diff)
movenc: Add a flag for indicating a discontinuous fragment
This allows creating a later mp4 fragment without sequentially writing the earlier ones before (when called from a segmenter). Normally when writing a fragmented mp4 file sequentially, the first timestamps of a fragment are adjusted to match the end of the previous fragment, to make sure the timestamp is the same, even if it is calculated as the sum of previous fragment durations. (And for the first packet in a file, the offset of the first packet is written using an edit list.) When writing an individual mp4 fragment discontinuously like this (with potentially writing the earlier fragments separately later), there's a risk of getting a gap in the timeline if the duration field of the last packet in the previous fragment doesn't match up with the start time of the next fragment. Using this requires setting -avoid_negative_ts make_non_negative (or -avoid_negative_ts 0). Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/movenc.h')
-rw-r--r--libavformat/movenc.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/movenc.h b/libavformat/movenc.h
index 4483b69e04..c13a834c7d 100644
--- a/libavformat/movenc.h
+++ b/libavformat/movenc.h
@@ -121,6 +121,7 @@ typedef struct MOVTrack {
AVIOContext *mdat_buf;
int64_t data_offset;
int64_t frag_start;
+ int frag_discont;
int nb_frag_info;
MOVFragmentInfo *frag_info;
@@ -182,6 +183,7 @@ typedef struct MOVMuxContext {
#define FF_MOV_FLAG_DISABLE_CHPL (1 << 9)
#define FF_MOV_FLAG_DEFAULT_BASE_MOOF (1 << 10)
#define FF_MOV_FLAG_DASH (1 << 11)
+#define FF_MOV_FLAG_FRAG_DISCONT (1 << 12)
int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt);