History

use flags field and remove key_frame field

Originally committed as revision 18831 to svn://svn.ffmpeg.org/ffmpeg/trunk

Baptiste Coudurier committed 17 years ago

Commit ab4752e1 parent fe335ff1 file · +7 −5Browse files

Unified · Split

libavformat/movenc.c+7−5
@@ -44,13 +44,14 @@ · 43 unmodified lines
44#define MODE_IPOD 0x2044#define MODE_IPOD 0x20
45 45
46typedef struct MOVIentry {46typedef struct MOVIentry {
47 unsigned int flags, size;47 unsigned int size;
48 uint64_t pos;48 uint64_t pos;
49 unsigned int samplesInChunk;49 unsigned int samplesInChunk;
50 char key_frame;
51 unsigned int entries;50 unsigned int entries;
52 int cts;51 int cts;
53 int64_t dts;52 int64_t dts;
53#define MOV_SYNC_SAMPLE 0x0001
54 uint32_t flags;
54} MOVIentry;55} MOVIentry;
55 56
56typedef struct MOVIndex {57typedef struct MOVIndex {
@@ -198,7 +199,7 @@ static int mov_write_stss_tag(ByteIOContext *pb, MOVTrack *track) · 141 unmodified lines
198 entryPos = url_ftell(pb);199 entryPos = url_ftell(pb);
199 put_be32(pb, track->entry); // entry count200 put_be32(pb, track->entry); // entry count
200 for (i=0; i<track->entry; i++) {201 for (i=0; i<track->entry; i++) {
201 if(track->cluster[i].key_frame == 1) {202 if (track->cluster[i].flags & MOV_SYNC_SAMPLE) {
202 put_be32(pb, i+1);203 put_be32(pb, i+1);
203 index++;204 index++;
204 }205 }
@@ -1877,9 +1878,10 @@ static int mov_write_packet(AVFormatContext *s, AVPacket *pkt) · 1672 unmodified lines
1877 if (pkt->dts != pkt->pts)1878 if (pkt->dts != pkt->pts)
1878 trk->hasBframes = 1;1879 trk->hasBframes = 1;
1879 trk->cluster[trk->entry].cts = pkt->pts - pkt->dts;1880 trk->cluster[trk->entry].cts = pkt->pts - pkt->dts;
1880 trk->cluster[trk->entry].key_frame = !!(pkt->flags & PKT_FLAG_KEY);1881 if (pkt->flags & PKT_FLAG_KEY) {
1881 if(trk->cluster[trk->entry].key_frame)1882 trk->cluster[trk->entry].flags = MOV_SYNC_SAMPLE;
1882 trk->hasKeyframes++;1883 trk->hasKeyframes++;
1884 }
1883 trk->entry++;1885 trk->entry++;
1884 trk->sampleCount += samplesInChunk;1886 trk->sampleCount += samplesInChunk;
1885 mov->mdat_size += size;1887 mov->mdat_size += size;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t