Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 11 Jan 2014 19:40:35 +0000 (20:40 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 11 Jan 2014 19:56:29 +0000 (20:56 +0100)
* qatar/master:
  flv: Workaround for buggy Omnia A/XE encoder

Conflicts:
libavformat/flvdec.c

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

@@@ -942,19 -904,25 +942,28 @@@ retry_duration
              if (flv->wrong_dts)
                  dts = AV_NOPTS_VALUE;
          }
 -        if (type == 0) {
 +        if (type == 0 && (!st->codec->extradata || st->codec->codec_id == AV_CODEC_ID_AAC)) {
++            AVDictionaryEntry *t;
++
              if (st->codec->extradata) {
 -                if ((ret = flv_queue_extradata(flv, s->pb, is_audio, size)) < 0)
 +                if ((ret = flv_queue_extradata(flv, s->pb, stream_type, size)) < 0)
                      return ret;
                  ret = AVERROR(EAGAIN);
                  goto leave;
              }
              if ((ret = flv_get_extradata(s, st, size)) < 0)
                  return ret;
 -            if (st->codec->codec_id == AV_CODEC_ID_AAC) {
 -                MPEG4AudioConfig cfg;
 -                /* Workaround for buggy Omnia A/XE encoder */
 -                AVDictionaryEntry *t = av_dict_get(s->metadata, "Encoder", NULL, 0);
 -                if (t && !strcmp(t->value, "Omnia A/XE"))
 -                    st->codec->extradata_size = 2;
++            /* Workaround for buggy Omnia A/XE encoder */
++            t = av_dict_get(s->metadata, "Encoder", NULL, 0);
++            if (st->codec->codec_id == AV_CODEC_ID_AAC && t && !strcmp(t->value, "Omnia A/XE"))
++                st->codec->extradata_size = 2;
++
 +            if (st->codec->codec_id == AV_CODEC_ID_AAC && 0) {
 +                MPEG4AudioConfig cfg;
 -                avpriv_mpeg4audio_get_config(&cfg, st->codec->extradata,
 -                                             st->codec->extradata_size * 8, 1);
 +                if (avpriv_mpeg4audio_get_config(&cfg, st->codec->extradata,
 +                                             st->codec->extradata_size * 8, 1) >= 0) {
                  st->codec->channels       = cfg.channels;
                  st->codec->channel_layout = 0;
                  if (cfg.ext_sample_rate)