Merge commit '117d8c6d1f1c187ffc6098d9618457e00534e013'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 20 Sep 2012 17:31:24 +0000 (19:31 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 20 Sep 2012 17:43:38 +0000 (19:43 +0200)
* commit '117d8c6d1f1c187ffc6098d9618457e00534e013':
  matroska: implement support for ProRes
  matroska: implement support for ALAC

Conflicts:
libavformat/matroskaenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavformat/matroska.c
libavformat/matroskadec.c
libavformat/matroskaenc.c

Simple merge
@@@ -1608,20 -1497,8 +1609,20 @@@ static int matroska_read_header(AVForma
          } else if (!strcmp(track->codec_id, "V_QUICKTIME")
                     && (track->codec_priv.size >= 86)
                     && (track->codec_priv.data != NULL)) {
 -            track->video.fourcc = AV_RL32(track->codec_priv.data);
 -            codec_id=ff_codec_get_id(ff_codec_movvideo_tags, track->video.fourcc);
 +            fourcc = AV_RL32(track->codec_priv.data);
 +            codec_id = ff_codec_get_id(ff_codec_movvideo_tags, fourcc);
 +        } else if (codec_id == AV_CODEC_ID_ALAC && track->codec_priv.size && track->codec_priv.size < INT_MAX-12) {
 +            /* Only ALAC's magic cookie is stored in Matroska's track headers.
 +               Create the "atom size", "tag", and "tag version" fields the
 +               decoder expects manually. */
 +            extradata_size = 12 + track->codec_priv.size;
-             extradata = av_mallocz(extradata_size);
++            extradata = av_mallocz(extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
 +            if (extradata == NULL)
 +                return AVERROR(ENOMEM);
 +            AV_WB32(extradata, extradata_size);
 +            memcpy(&extradata[4], "alac", 4);
 +            AV_WB32(&extradata[8], 0);
 +            memcpy(&extradata[12], track->codec_priv.data, track->codec_priv.size);
          } else if (codec_id == AV_CODEC_ID_PCM_S16BE) {
              switch (track->audio.bitdepth) {
              case  8:  codec_id = AV_CODEC_ID_PCM_U8;     break;
Simple merge