From a336965e703d3e5099dcc024a401f3cf44e3348a Mon Sep 17 00:00:00 2001 From: Baptiste Coudurier Date: Mon, 10 Apr 2006 17:04:22 +0000 Subject: fix edts for tracks without b frames Originally committed as revision 5282 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/movenc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libavformat') diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 66686ea..b7d6795 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -946,7 +946,10 @@ static int mov_write_edts_tag(ByteIOContext *pb, MOVTrack *track) put_be32(pb, av_rescale_rnd(track->trackDuration, globalTimescale, track->timescale, AV_ROUND_UP)); /* duration ... doesn't seem to effect psp */ - put_be32(pb, track->sampleDuration); + if (track->hasBframes) + put_be32(pb, track->sampleDuration); /* first pts is 1 */ + else + put_be32(pb, 0); put_be32(pb, 0x00010000); return 0x24; } -- cgit v1.1