summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-07-11 20:35:02 +0200
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-07-12 19:44:59 +0200
commit896e59758a11ff645879098b5ebca2e753731b4e (patch)
tree88d2053e5dba0296cbc216e9e829252e3878dfd7 /libavformat
parent45ecc7a294d56e41dab621512f6f70fc2578340e (diff)
Move resetting of channels, sample_rate back to av_find_stream_info.
Resetting it on codec init would incorrectly clear the values if av_find_stream_info was already run before, in particular breaking ffplay. This fixes trac tickets #213 and #262. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 654bc8aae5..b9a4ebab9d 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2261,6 +2261,15 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
for(i=0;i<ic->nb_streams;i++) {
AVCodec *codec;
st = ic->streams[i];
+ if (st->codec->codec_id == CODEC_ID_AAC && st->codec->extradata_size) {
+ // We need to discard these since they can be plain wrong for
+ // backwards compatible HE-AAC signaling.
+ // But when we have no extradata we need to keep them or we can't
+ // play anything at all.
+ st->codec->sample_rate = 0;
+ st->codec->frame_size = 0;
+ st->codec->channels = 0;
+ }
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO ||
st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {