diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-23 12:17:10 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-23 12:17:10 +0200 |
commit | b189c699b98cc2c563e6e9778013d3753476ed1e (patch) | |
tree | 700011dffd0ffc2ff6a70dc2e5abd5f5b39ddd5e | |
parent | 03e9506aae31d012ab822722c43b40b8d4a191a8 (diff) | |
parent | 187023f6b2b43966acb2449a379b4ededdc4b22e (diff) | |
download | ffmpeg-b189c699b98cc2c563e6e9778013d3753476ed1e.tar.gz |
Merge commit '187023f6b2b43966acb2449a379b4ededdc4b22e'
* commit '187023f6b2b43966acb2449a379b4ededdc4b22e':
movenc: Set mov->mode earlier in mov_write_header
Conflicts:
libavformat/movenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/movenc.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 61f397b5d0..0b4669bdf3 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -3609,10 +3609,23 @@ static int mov_write_header(AVFormatContext *s) AVDictionaryEntry *t, *global_tcr = av_dict_get(s->metadata, "timecode", NULL, 0); int i, hint_track = 0, tmcd_track = 0; + /* Default mode == MP4 */ + mov->mode = MODE_MP4; + + if (s->oformat != NULL) { + if (!strcmp("3gp", s->oformat->name)) mov->mode = MODE_3GP; + else if (!strcmp("3g2", s->oformat->name)) mov->mode = MODE_3GP|MODE_3G2; + else if (!strcmp("mov", s->oformat->name)) mov->mode = MODE_MOV; + else if (!strcmp("psp", s->oformat->name)) mov->mode = MODE_PSP; + else if (!strcmp("ipod",s->oformat->name)) mov->mode = MODE_IPOD; + else if (!strcmp("ismv",s->oformat->name)) mov->mode = MODE_ISM; + else if (!strcmp("f4v", s->oformat->name)) mov->mode = MODE_F4V; + } + /* Set the FRAGMENT flag if any of the fragmentation methods are * enabled. */ if (mov->max_fragment_duration || mov->max_fragment_size || - (s->oformat && !strcmp(s->oformat->name, "ismv")) || + mov->mode == MODE_ISM || mov->flags & (FF_MOV_FLAG_EMPTY_MOOV | FF_MOV_FLAG_FRAG_KEYFRAME | FF_MOV_FLAG_FRAG_CUSTOM)) @@ -3641,17 +3654,6 @@ static int mov_write_header(AVFormatContext *s) return -1; } - /* Default mode == MP4 */ - mov->mode = MODE_MP4; - - if (!strcmp("3gp", s->oformat->name)) mov->mode = MODE_3GP; - else if (!strcmp("3g2", s->oformat->name)) mov->mode = MODE_3GP|MODE_3G2; - else if (!strcmp("mov", s->oformat->name)) mov->mode = MODE_MOV; - else if (!strcmp("psp", s->oformat->name)) mov->mode = MODE_PSP; - else if (!strcmp("ipod",s->oformat->name)) mov->mode = MODE_IPOD; - else if (!strcmp("ismv",s->oformat->name)) mov->mode = MODE_ISM; - else if (!strcmp("f4v", s->oformat->name)) mov->mode = MODE_F4V; - mov_write_ftyp_tag(pb,s); if (mov->mode == MODE_PSP) { int video_streams_nb = 0, audio_streams_nb = 0, other_streams_nb = 0; |