diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-09-29 14:42:11 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-09-29 14:45:55 +0200 |
commit | 8672fc7b0453098d862bb1c0caafab4823ee0b4e (patch) | |
tree | 61e47d15de63bd72f6e6a73ecfb8697bb4b687b1 /libavcodec/utils.c | |
parent | 74bd0cf49c9c0bee8d4f3d3a98a7343c2ff5b94c (diff) | |
parent | b146d74730ab9ec5abede9066f770ad851e45fbc (diff) | |
download | ffmpeg-8672fc7b0453098d862bb1c0caafab4823ee0b4e.tar.gz |
Merge commit 'b146d74730ab9ec5abede9066f770ad851e45fbc'
* commit 'b146d74730ab9ec5abede9066f770ad851e45fbc':
indeo4: update AVCodecContext width/height on size change
dfa: check that the caller set width/height properly.
indeo5dec: Make sure we have had a valid gop header.
cavsdec: check for changing w/h.
lavc: set channel count from channel layout in avcodec_open2().
doc/platform: Rework the Visual Studio linking section
doc/faq: Change the Visual Studio entry to reflect current status
doc/platform: Replace Visual Studio section with build instructions
doc/platform: Nuke section on linking static MinGW-built libs with MSVC
doc/platform: Remove false claim about MinGW installer
doc/platform: Mention MinGW-w64
dsputil_mmx: fix reading prior of the src array in sub_hfyu_median_prediction()
mpegaudiodec: fix short_start calculation
Conflicts:
doc/faq.texi
doc/platform.texi
libavcodec/cavsdec.c
libavcodec/indeo5.c
libavcodec/ivi_common.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 53b8b2bf1f..c462a9d51e 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1023,10 +1023,15 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code if (!avctx->bit_rate) avctx->bit_rate = get_bit_rate(avctx); /* validate channel layout from the decoder */ - if (avctx->channel_layout && - av_get_channel_layout_nb_channels(avctx->channel_layout) != avctx->channels) { - av_log(avctx, AV_LOG_WARNING, "channel layout does not match number of channels\n"); - avctx->channel_layout = 0; + if (avctx->channel_layout) { + int channels = av_get_channel_layout_nb_channels(avctx->channel_layout); + if (!avctx->channels) + avctx->channels = channels; + else if (channels != avctx->channels) { + av_log(avctx, AV_LOG_WARNING, + "channel layout does not match number of channels\n"); + avctx->channel_layout = 0; + } } } end: |