movenc: Always write EDTS when we are able to.

Inspired by a patch from Michael Root
Idea-by: Baptiste Coudurier
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2011-12-07 05:06:13 +01:00
parent 1fa8ff38e4
commit 901af94b69
19 changed files with 38 additions and 39 deletions

View File

@ -1401,9 +1401,8 @@ static int mov_write_trak_tag(AVIOContext *pb, MOVMuxContext *mov, MOVTrack *tra
avio_wb32(pb, 0); /* size */
ffio_wfourcc(pb, "trak");
mov_write_tkhd_tag(pb, track, st);
if (track->mode == MODE_PSP || track->flags & MOV_TRACK_CTTS || track->cluster[0].dts)
if(!mov->fragments) // EDTS with fragments is tricky as we dont know the duration when its written
mov_write_edts_tag(pb, track); // PSP Movies require edts box
if(!mov->fragments) // EDTS with fragments is tricky as we dont know the duration when its written
mov_write_edts_tag(pb, track); // PSP Movies and several other cases require edts box
if (track->tref_tag)
mov_write_tref_tag(pb, track);
mov_write_mdia_tag(pb, track);