# HG changeset patch # User bcoudurier # Date 1144934480 0 # Node ID faa09c43a3d6f77a9dfcea649e71908550cd7bba # Parent b38a08b0cd12ca3215ad1d07a89bd0efb09c1e10 write mdat in write_header avoid check in write_packet diff -r b38a08b0cd12 -r faa09c43a3d6 movenc.c --- a/movenc.c Tue Apr 11 08:12:54 2006 +0000 +++ b/movenc.c Thu Apr 13 13:21:20 2006 +0000 @@ -69,7 +69,6 @@ int mode; int64_t time; int nb_streams; - int mdat_written; offset_t mdat_pos; long timescale; MOVTrack tracks[MAX_STREAMS]; @@ -1620,6 +1619,9 @@ mov->tracks[i].mode = mov->mode; } + mov_write_mdat_tag(pb, mov); + mov->time = s->timestamp + 0x7C25B080; //1970 based -> 1904 based + put_flush_packet(pb); return 0; @@ -1701,11 +1703,6 @@ return -1; trk->ents_allocated += MOV_INDEX_CLUSTER_SIZE; } - if (mov->mdat_written == 0) { - mov_write_mdat_tag(pb, mov); - mov->mdat_written = 1; - mov->time = s->timestamp + 0x7C25B080; //1970 based -> 1904 based - } trk->cluster[cl][id].pos = url_ftell(pb); trk->cluster[cl][id].samplesInChunk = samplesInChunk;