OSDN Git Service

check sample_fmt in avcodec_open
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Wed, 9 Feb 2011 15:52:33 +0000 (10:52 -0500)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 11 Feb 2011 01:54:08 +0000 (02:54 +0100)
commit7ade06cc2eeb1f9521fd70098b2ae03064a91120
tree2da8ac774a0b732da200419122338aaea5271dd0
parent6ff532b95d57444270696112f85b468f7fe5d422
check sample_fmt in avcodec_open

check AVCodecContext->sample_fmt against AVCodec->sample_fmts[] to ensure
that the encoder supports the specified sample format. Error out if it doesn't.
Previously, it would continue and output garbage. Fixes issue 2587.
(cherry picked from commit 2cfa2d925808e6cc6fb7a7c133b7cb7622afd37e)
libavcodec/utils.c