diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-04-25 21:08:29 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-04-25 21:33:18 +0200 |
commit | c9e0f7a080c1eb29e89ea2ba163d6b790ce1ff20 (patch) | |
tree | 61b90fb7e3815f192aacf77546d4fdba26d1c113 /libavformat/movenc.c | |
parent | 944a744bf58534a00b2996910a5a4ac10c260169 (diff) | |
parent | 99e22b7859177f6d3ed6121040924b337dce5497 (diff) | |
download | ffmpeg-c9e0f7a080c1eb29e89ea2ba163d6b790ce1ff20.tar.gz |
Merge commit '99e22b7859177f6d3ed6121040924b337dce5497'
* commit '99e22b7859177f6d3ed6121040924b337dce5497':
mov: Emit the correct tags for clcp tracks
Conflicts:
libavformat/movenc.c
See: a5f6720f13c7678c61be1413debf3e11e678781c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 808a2bc098..18910761c4 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -1578,6 +1578,12 @@ static int mov_write_vmhd_tag(AVIOContext *pb) return 0x14; } +static int is_clcp_track(MOVTrack *track) +{ + return track->tag == MKTAG('c','7','0','8') || + track->tag == MKTAG('c','6','0','8'); +} + static int mov_write_hdlr_tag(AVIOContext *pb, MOVTrack *track) { const char *hdlr, *descr = NULL, *hdlr_type = NULL; @@ -1596,7 +1602,7 @@ static int mov_write_hdlr_tag(AVIOContext *pb, MOVTrack *track) hdlr_type = "soun"; descr = "SoundHandler"; } else if (track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE) { - if (track->tag == MKTAG('c','6','0','8')) { + if (is_clcp_track(track)) { hdlr_type = "clcp"; descr = "ClosedCaptionHandler"; } else { @@ -1667,7 +1673,7 @@ static int mov_write_minf_tag(AVIOContext *pb, MOVTrack *track) else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) mov_write_smhd_tag(pb); else if (track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE) { - if (track->tag == MKTAG('t','e','x','t') || track->tag == MKTAG('c','6','0','8')) { + if (track->tag == MKTAG('t','e','x','t') || is_clcp_track(track)) { mov_write_gmhd_tag(pb, track); } else { mov_write_nmhd_tag(pb); @@ -1973,10 +1979,16 @@ static int mov_write_trak_tag(AVIOContext *pb, MOVMuxContext *mov, mov_write_uuid_tag_psp(pb, track); // PSP Movies require this uuid box if (track->tag == MKTAG('r','t','p',' ')) mov_write_udta_sdp(pb, track); - if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO && track->mode == MODE_MOV) { - double sample_aspect_ratio = av_q2d(st->sample_aspect_ratio); - if (st->sample_aspect_ratio.num && 1.0 != sample_aspect_ratio) + if (track->mode == MODE_MOV) { + if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) { + double sample_aspect_ratio = av_q2d(st->sample_aspect_ratio); + if (st->sample_aspect_ratio.num && 1.0 != sample_aspect_ratio) { + mov_write_tapt_tag(pb, track); + } + } + if (is_clcp_track(track)) { mov_write_tapt_tag(pb, track); + } } return update_size(pb, pos); } |