aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-07-01 05:33:39 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-07-01 05:35:26 +0200
commit721be993713550e7f1c3bccf670fd0a1be7e7738 (patch)
tree500c5f113ad0092f52bca3bbb9db807d82c4ac92 /libavformat/utils.c
parent9251942ca728e7807a2a95306415b27b36a8b8e7 (diff)
parentbe73d76b34481686020e423ccabcca77042d0ede (diff)
downloadffmpeg-721be993713550e7f1c3bccf670fd0a1be7e7738.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: cosmetics: fix some then/than typos doxygen: Include libavcodec and libavformat examples into the documentation avutil: elaborate documentation for av_get_random_seed Add support for aac streams in mp4/mov without extradata. aes: whitespace cosmetics adler32: whitespace cosmetics swscale: fix another yuv range conversion overflow in 16bit scaling. Fix cpu flags test program opt-test: Add missing braces to silence compiler warnings. build: Eliminate obsolete test targets. udp: Fix a compilation warning swscale: Unbreak build with --enable-small base64: add fate test aes: improve test program and add fate test adler32: make test program more useful and add fate test swscale: fix yuv range correction when using 16-bit scaling. aacenc: Make chan_map const correct Conflicts: Makefile doc/examples/muxing-example.c libavformat/udp.c libavutil/random_seed.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 4d8b9225fb..b3f0e12a65 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2246,11 +2246,7 @@ int av_find_stream_info(AVFormatContext *ic)
for(i=0;i<ic->nb_streams;i++) {
AVCodec *codec;
st = ic->streams[i];
- if (st->codec->codec_id == CODEC_ID_AAC) {
- 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) {
/* if(!st->time_base.num)
@@ -2268,13 +2264,6 @@ int av_find_stream_info(AVFormatContext *ic)
assert(!st->codec->codec);
codec = avcodec_find_decoder(st->codec->codec_id);
- /* Force decoding of at least one frame of codec data
- * this makes sure the codec initializes the channel configuration
- * and does not trust the values from the container.
- */
- if (codec && codec->capabilities & CODEC_CAP_CHANNEL_CONF)
- st->codec->channels = 0;
-
/* Ensure that subtitle_header is properly set. */
if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE
&& codec && !st->codec->codec)
@@ -2417,8 +2406,16 @@ int av_find_stream_info(AVFormatContext *ic)
/* if still no information, we try to open the codec and to
decompress the frame. We try to avoid that in most cases as
it takes longer and uses more memory. For MPEG-4, we need to
- decompress for QuickTime. */
- if (!has_codec_parameters(st->codec) || !has_decode_delay_been_guessed(st))
+ decompress for QuickTime.
+
+ If CODEC_CAP_CHANNEL_CONF is set this will force decoding of at
+ least one frame of codec data, this makes sure the codec initializes
+ the channel configuration and does not only trust the values from the container.
+ */
+ if (!has_codec_parameters(st->codec) ||
+ !has_decode_delay_been_guessed(st) ||
+ (st->codec->codec &&
+ st->codec->codec->capabilities & CODEC_CAP_CHANNEL_CONF))
try_decode_frame(st, pkt);
st->codec_info_nb_frames++;