Merge commit '99e22b7859177f6d3ed6121040924b337dce5497'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 25 Apr 2014 19:08:29 +0000 (21:08 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 25 Apr 2014 19:33:18 +0000 (21:33 +0200)
* commit '99e22b7859177f6d3ed6121040924b337dce5497':
  mov: Emit the correct tags for clcp tracks

Conflicts:
libavformat/movenc.c

See: a5f6720f13c7678c61be1413debf3e11e678781c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavformat/movenc.c

@@@ -1596,19 -1319,16 +1602,19 @@@ static int mov_write_hdlr_tag(AVIOConte
              hdlr_type = "soun";
              descr     = "SoundHandler";
          } else if (track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE) {
-             if (track->tag == MKTAG('c','6','0','8')) {
 -            if (track->tag == MKTAG('t','x','3','g')) {
 -                hdlr_type = "sbtl";
 -            } else if (track->tag == MKTAG('m','p','4','s')) {
 -                hdlr_type = "subp";
 -            } else if (is_clcp_track(track)) {
++            if (is_clcp_track(track)) {
                  hdlr_type = "clcp";
 +                descr = "ClosedCaptionHandler";
              } else {
 -                hdlr_type = "text";
 -            }
 +                if (track->tag == MKTAG('t','x','3','g')) {
 +                    hdlr_type = "sbtl";
 +                } else if (track->tag == MKTAG('m','p','4','s')) {
 +                    hdlr_type = "subp";
 +                } else {
 +                    hdlr_type = "text";
 +                }
              descr = "SubtitleHandler";
 +            }
          } else if (track->enc->codec_tag == MKTAG('r','t','p',' ')) {
              hdlr_type = "hint";
              descr     = "HintHandler";
@@@ -1667,8 -1387,8 +1673,8 @@@ static int mov_write_minf_tag(AVIOConte
      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);
 +            mov_write_gmhd_tag(pb, track);
          } else {
              mov_write_nmhd_tag(pb);
          }
@@@ -1973,10 -1671,16 +1979,16 @@@ static int mov_write_trak_tag(AVIOConte
          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 ((0.0 != sample_aspect_ratio && 1.0 != 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);
  }