summaryrefslogtreecommitdiff
path: root/libavformat/movenc.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2006-04-13 13:21:20 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2006-04-13 13:21:20 +0000
commit18c697acce485df010ec44b8c3b148c8f46656ca (patch)
tree24c78262428f55218ebc6de4d7a9658b770df963 /libavformat/movenc.c
parent490c189bc8c92413af3b02287fb31a53528c87bf (diff)
write mdat in write_header avoid check in write_packet
Originally committed as revision 5286 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r--libavformat/movenc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index f1529596f8..0ef047439f 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -69,7 +69,6 @@ typedef struct MOVContext {
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 @@ static int mov_write_header(AVFormatContext *s)
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 @@ static int mov_write_packet(AVFormatContext *s, AVPacket *pkt)
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;