X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fflvdec.c;h=b11e3352c1c815572aee3f881a9f9cf81a575d5a;hb=fb1c786a9dc646b7fdd1d15ad98a4be87c8deb87;hp=5683ed514e8c51dc34cbb10f31ae162935d9d987;hpb=3c00d4c5f0ae855981a0cf8addfae0c948414625;p=ffmpeg diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 5683ed514e8..b11e3352c1c 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -916,7 +916,7 @@ retry_duration: flv->last_channels = channels = st->codec->channels; } else { - AVCodecContext ctx; + AVCodecContext ctx = {0}; ctx.sample_rate = sample_rate; flv_set_audio_codec(s, st, &ctx, flags & FLV_AUDIO_CODECID_MASK); sample_rate = ctx.sample_rate; @@ -943,6 +943,8 @@ retry_duration: dts = AV_NOPTS_VALUE; } 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, stream_type, size)) < 0) return ret; @@ -951,8 +953,15 @@ retry_duration: } if ((ret = flv_get_extradata(s, st, size)) < 0) return ret; + + /* 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; + if (avpriv_mpeg4audio_get_config(&cfg, st->codec->extradata, st->codec->extradata_size * 8, 1) >= 0) { st->codec->channels = cfg.channels;