Merge commit '0ba5299a805e9ccaef1a757381fc2ada4d54b8a1'
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 18 May 2014 20:27:27 +0000 (22:27 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 18 May 2014 20:29:27 +0000 (22:29 +0200)
* commit '0ba5299a805e9ccaef1a757381fc2ada4d54b8a1':
  movenc: use the "encoder" metadata tag to write stsd Compressorname

Conflicts:
libavformat/movenc.c
libavformat/movenc.h

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

@@@ -1182,34 -1001,9 +1182,36 @@@ static int mov_write_pasp_tag(AVIOConte
      return 16;
  }
  
 -static int mov_write_video_tag(AVIOContext *pb, MOVTrack *track)
 +static void find_compressor(char * compressor_name, int len, MOVTrack *track)
  {
-     if (track->mode == MODE_MOV && track->enc->codec && track->enc->codec->name) {
-         av_strlcpy(compressor_name, track->enc->codec->name, 32);
+     AVDictionaryEntry *encoder;
 +    int xdcam_res =  (track->enc->width == 1280 && track->enc->height == 720)
 +                  || (track->enc->width == 1440 && track->enc->height == 1080)
 +                  || (track->enc->width == 1920 && track->enc->height == 1080);
 +
++    if (track->mode == MODE_MOV &&
++        (encoder = av_dict_get(track->st->metadata, "encoder", NULL, 0))) {
++        av_strlcpy(compressor_name, encoder->value, 32);
 +    } else if (track->enc->codec_id == AV_CODEC_ID_MPEG2VIDEO && xdcam_res) {
 +        int interlaced = track->enc->field_order > AV_FIELD_PROGRESSIVE;
 +        AVStream *st = track->st;
 +        int rate = av_q2d(find_fps(NULL, st));
 +        av_strlcatf(compressor_name, len, "XDCAM");
 +        if (track->enc->pix_fmt == AV_PIX_FMT_YUV422P) {
 +            av_strlcatf(compressor_name, len, " HD422");
 +        } else if(track->enc->width == 1440) {
 +            av_strlcatf(compressor_name, len, " HD");
 +        } else
 +            av_strlcatf(compressor_name, len, " EX");
 +
 +        av_strlcatf(compressor_name, len, " %d%c", track->enc->height, interlaced ? 'i' : 'p');
 +
 +        av_strlcatf(compressor_name, len, "%d", rate * (interlaced + 1));
 +    }
 +}
 +
 +static int mov_write_video_tag(AVIOContext *pb, MOVTrack *track)
 +{
      int64_t pos = avio_tell(pb);
      char compressor_name[32] = { 0 };
  
Simple merge