diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-30 02:15:39 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-30 02:17:54 +0100 |
commit | 647405d1110cb083e96d892646d2d1367946e39a (patch) | |
tree | 9d337de694a462f3fa54e657cbf343b1772d0c76 /libavformat | |
parent | 32e666c354e4a3160d8cf1d303cb51990b095c87 (diff) | |
parent | 573b1de2d7f1db71030f91ecdded7d0bc071f6b6 (diff) | |
download | ffmpeg-647405d1110cb083e96d892646d2d1367946e39a.tar.gz |
Merge commit '573b1de2d7f1db71030f91ecdded7d0bc071f6b6'
* commit '573b1de2d7f1db71030f91ecdded7d0bc071f6b6':
movenc: Don't use track_id to decide which track is the first in a moof
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/movenc.c | 4 | ||||
-rw-r--r-- | libavformat/movenc.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index a43752a011..68b3d74ef8 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -3189,7 +3189,7 @@ static int mov_write_trun_tag(AVIOContext *pb, MOVMuxContext *mov, avio_wb32(pb, track->entry); /* sample count */ if (mov->flags & FF_MOV_FLAG_OMIT_TFHD_OFFSET && !(mov->flags & FF_MOV_FLAG_SEPARATE_MOOF) && - track->track_id != 1) + !mov->first_trun) avio_wb32(pb, 0); /* Later tracks follow immediately after the previous one */ else avio_wb32(pb, moof_size + 8 + track->data_offset + @@ -3208,6 +3208,7 @@ static int mov_write_trun_tag(AVIOContext *pb, MOVMuxContext *mov, avio_wb32(pb, track->cluster[i].cts); } + mov->first_trun = 0; return update_size(pb, pos); } @@ -3328,6 +3329,7 @@ static int mov_write_moof_tag_internal(AVIOContext *pb, MOVMuxContext *mov, avio_wb32(pb, 0); /* size placeholder */ ffio_wfourcc(pb, "moof"); + mov->first_trun = 1; mov_write_mfhd_tag(pb, mov); for (i = 0; i < mov->nb_streams; i++) { diff --git a/libavformat/movenc.h b/libavformat/movenc.h index 4e7db7a476..c9faee6acd 100644 --- a/libavformat/movenc.h +++ b/libavformat/movenc.h @@ -171,6 +171,7 @@ typedef struct MOVMuxContext { int max_fragment_size; int ism_lookahead; AVIOContext *mdat_buf; + int first_trun; int use_editlist; int video_track_timescale; |