check sample_fmt in avcodec_open
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Wed, 9 Feb 2011 15:52:33 +0000 (10:52 -0500)
committerRonald S. Bultje <rsbultje@gmail.com>
Wed, 9 Feb 2011 20:30:53 +0000 (15:30 -0500)
commit2cfa2d925808e6cc6fb7a7c133b7cb7622afd37e
tree1d57ab59a0bcb228aec02414382a9da6704b4aab
parentf4c79d1e0b2e797012304db57903e4091b0c2d7c
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.
libavcodec/utils.c