Module: libav Branch: master Commit: c2c22c75cf89e2faab34d1ee1d392cfb065439ea
Author: Martin Storsjö <[email protected]> Committer: Martin Storsjö <[email protected]> Date: Mon Oct 6 23:20:50 2014 +0300 movenc: Write tfdt atoms These allow getting the absolute start timestamp of a fragment without reading preceding timestamps. This fixes sync between tracks if starting from fragments in different streams that don't align exactly. This also is a prerequisite for producing DASH content. Signed-off-by: Martin Storsjö <[email protected]> --- libavformat/movenc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index d8dc62a..d84ddbe 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -2550,6 +2550,18 @@ static int mov_write_tfrf_tags(AVIOContext *pb, MOVMuxContext *mov, return 0; } +static int mov_write_tfdt_tag(AVIOContext *pb, MOVTrack *track) +{ + int64_t pos = avio_tell(pb); + + avio_wb32(pb, 0); /* size */ + ffio_wfourcc(pb, "tfdt"); + avio_w8(pb, 1); /* version */ + avio_wb24(pb, 0); + avio_wb64(pb, track->frag_start); + return update_size(pb, pos); +} + static int mov_write_traf_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track, int64_t moof_offset, int moof_size) @@ -2559,6 +2571,7 @@ static int mov_write_traf_tag(AVIOContext *pb, MOVMuxContext *mov, ffio_wfourcc(pb, "traf"); mov_write_tfhd_tag(pb, mov, track, moof_offset); + mov_write_tfdt_tag(pb, track); mov_write_trun_tag(pb, mov, track, moof_size); if (mov->mode == MODE_ISM) { mov_write_tfxd_tag(pb, track); _______________________________________________ libav-commits mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-commits
