Merge commit 'f771b3ab5d3c0b763ee356152be550f4121babd0'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 27 Jan 2015 15:17:42 +0000 (16:17 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 27 Jan 2015 15:17:42 +0000 (16:17 +0100)
* commit 'f771b3ab5d3c0b763ee356152be550f4121babd0':
  avidec: do not export stream_codec_tag

Conflicts:
libavformat/avidec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/mpeg4videodec.c
libavformat/avidec.c

@@@ -2106,17 -2046,8 +2106,16 @@@ static int decode_user_data(Mpeg4DecCon
      if (e == 1)
          ctx->xvid_build = build;
  
 +    return 0;
 +}
 +
 +int ff_mpeg4_workaround_bugs(AVCodecContext *avctx)
 +{
 +    Mpeg4DecContext *ctx = avctx->priv_data;
 +    MpegEncContext *s = &ctx->m;
 +
      if (ctx->xvid_build == -1 && ctx->divx_version == -1 && ctx->lavc_build == -1) {
-         if (s->stream_codec_tag == AV_RL32("XVID") ||
-             s->codec_tag        == AV_RL32("XVID") ||
+         if (s->codec_tag        == AV_RL32("XVID") ||
              s->codec_tag        == AV_RL32("XVIX") ||
              s->codec_tag        == AV_RL32("RMP4") ||
              s->codec_tag        == AV_RL32("ZMP4") ||
@@@ -626,8 -515,8 +627,8 @@@ static int avi_read_header(AVFormatCont
                  break;
              }
  
 -            assert(stream_index < s->nb_streams);
 +            av_assert0(stream_index < s->nb_streams);
-             st->codec->stream_codec_tag = handler;
+             ast->handler = handler;
  
              avio_rl32(pb); /* flags */
              avio_rl16(pb); /* priority */
                      /* This is needed to get the pict type which is necessary
                       * for generating correct pts. */
                      st->need_parsing = AVSTREAM_PARSE_HEADERS;
 -                    // Support "Resolution 1:1" for Avid AVI Codec
 -                    if (tag1 == MKTAG('A', 'V', 'R', 'n') &&
 -                        st->codec->extradata_size >= 31   &&
 -                        !memcmp(&st->codec->extradata[28], "1:1", 3))
 -                        st->codec->codec_id = AV_CODEC_ID_RAWVIDEO;
+                     if (st->codec->codec_id == AV_CODEC_ID_MPEG4 &&
+                         ast->handler == MKTAG('X', 'V', 'I', 'D'))
+                         st->codec->codec_tag = MKTAG('X', 'V', 'I', 'D');
 +                    if (st->codec->codec_tag == MKTAG('V', 'S', 'S', 'H'))
 +                        st->need_parsing = AVSTREAM_PARSE_FULL;
  
                      if (st->codec->codec_tag == 0 && st->codec->height > 0 &&
                          st->codec->extradata_size < 1U << 30) {
                          st->need_parsing = AVSTREAM_PARSE_NONE;
                      /* AVI files with Xan DPCM audio (wrongly) declare PCM
                       * audio in the header but have Axan as stream_code_tag. */
-                     if (st->codec->stream_codec_tag == AV_RL32("Axan")) {
+                     if (ast->handler == AV_RL32("Axan")) {
                          st->codec->codec_id  = AV_CODEC_ID_XAN_DPCM;
                          st->codec->codec_tag = 0;
 +                        ast->dshow_block_align = 0;
                      }
                      if (amv_file_format) {
                          st->codec->codec_id    = AV_CODEC_ID_ADPCM_IMA_AMV;