diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 510cef5..42496b5 100644
|
a
|
b
|
static int mov_write_tkhd_tag(AVIOContext *pb, MOVTrack *track, AVStream *st) |
| 1602 | 1602 | (version == 1) ? avio_wb32(pb, 104) : avio_wb32(pb, 92); /* size */ |
| 1603 | 1603 | ffio_wfourcc(pb, "tkhd"); |
| 1604 | 1604 | avio_w8(pb, version); |
| 1605 | | avio_wb24(pb, 0xf); /* flags (track enabled) */ |
| | 1605 | avio_wb24(pb, track->secondary ? 0x2 : 0xf); /* flags (first track enabled) */ |
| 1606 | 1606 | if (version == 1) { |
| 1607 | 1607 | avio_wb64(pb, track->time); |
| 1608 | 1608 | avio_wb64(pb, track->time); |
| … |
… |
static int mov_write_moov_tag(AVIOContext *pb, MOVMuxContext *mov, |
| 2315 | 2315 | { |
| 2316 | 2316 | int i; |
| 2317 | 2317 | int64_t pos = avio_tell(pb); |
| | 2318 | int not_first[AVMEDIA_TYPE_NB]={0}; |
| 2318 | 2319 | avio_wb32(pb, 0); /* size placeholder*/ |
| 2319 | 2320 | ffio_wfourcc(pb, "moov"); |
| 2320 | 2321 | |
| … |
… |
static int mov_write_moov_tag(AVIOContext *pb, MOVMuxContext *mov, |
| 2355 | 2356 | mov_write_iods_tag(pb, mov); |
| 2356 | 2357 | for (i=0; i<mov->nb_streams; i++) { |
| 2357 | 2358 | if (mov->tracks[i].entry > 0 || mov->flags & FF_MOV_FLAG_FRAGMENT) { |
| | 2359 | if(i < s->nb_streams){ |
| | 2360 | int codec_type= s->streams[i]->codec->codec_type; |
| | 2361 | if(codec_type==AVMEDIA_TYPE_AUDIO || codec_type==AVMEDIA_TYPE_SUBTITLE){ |
| | 2362 | mov->tracks[i].secondary= not_first[codec_type]; |
| | 2363 | not_first[codec_type]= 1; |
| | 2364 | } |
| | 2365 | } |
| 2358 | 2366 | mov_write_trak_tag(pb, mov, &(mov->tracks[i]), i < s->nb_streams ? s->streams[i] : NULL); |
| 2359 | 2367 | } |
| 2360 | 2368 | } |
diff --git a/libavformat/movenc.h b/libavformat/movenc.h
index b5d066f..a5db895 100644
|
a
|
b
|
typedef struct MOVIndex { |
| 94 | 94 | #define MOV_TIMECODE_FLAG_ALLOWNEGATIVE 0x0004 |
| 95 | 95 | uint32_t timecode_flags; |
| 96 | 96 | int language; |
| | 97 | int secondary; |
| 97 | 98 | int track_id; |
| 98 | 99 | int tag; ///< stsd fourcc |
| 99 | 100 | AVCodecContext *enc; |