diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-05-14 21:05:52 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-05-14 21:05:52 +0000 |
commit | ab4752e3820002eaa712ab272538f7a210b719d3 (patch) | |
tree | 77edf4187c17f09cd607aae3acf3772840acb007 | |
parent | fe335ff530786e4403c8b86c3068f3e1409588bb (diff) | |
download | ffmpeg-ab4752e3820002eaa712ab272538f7a210b719d3.tar.gz |
use flags field and remove key_frame field
Originally committed as revision 18831 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/movenc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 809a4f897f..624189a04a 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -44,13 +44,14 @@ #define MODE_IPOD 0x20 typedef struct MOVIentry { - unsigned int flags, size; + unsigned int size; uint64_t pos; unsigned int samplesInChunk; - char key_frame; unsigned int entries; int cts; int64_t dts; +#define MOV_SYNC_SAMPLE 0x0001 + uint32_t flags; } MOVIentry; typedef struct MOVIndex { @@ -198,7 +199,7 @@ static int mov_write_stss_tag(ByteIOContext *pb, MOVTrack *track) entryPos = url_ftell(pb); put_be32(pb, track->entry); // entry count for (i=0; i<track->entry; i++) { - if(track->cluster[i].key_frame == 1) { + if (track->cluster[i].flags & MOV_SYNC_SAMPLE) { put_be32(pb, i+1); index++; } @@ -1877,9 +1878,10 @@ static int mov_write_packet(AVFormatContext *s, AVPacket *pkt) if (pkt->dts != pkt->pts) trk->hasBframes = 1; trk->cluster[trk->entry].cts = pkt->pts - pkt->dts; - trk->cluster[trk->entry].key_frame = !!(pkt->flags & PKT_FLAG_KEY); - if(trk->cluster[trk->entry].key_frame) + if (pkt->flags & PKT_FLAG_KEY) { + trk->cluster[trk->entry].flags = MOV_SYNC_SAMPLE; trk->hasKeyframes++; + } trk->entry++; trk->sampleCount += samplesInChunk; mov->mdat_size += size; |