diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2011-07-26 23:58:10 +0400 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2011-07-26 23:58:10 +0400 |
commit | dcf1830a15a1e9ad1e16086369d55d8cb3a14e83 (patch) | |
tree | 3651bd8e7001dc7b94a8912cf3742c0716b851ae /libavcodec/utils.c | |
parent | 0a48a67e57873b938c49ca57b0629e3e33fe37db (diff) |
For FFmpeg 0.7 branch: Treat AV_SAMPLE_FMT_NONE as S16 for encoders.
This fixes compatibility with e.g. pcm_a52 ALSA plugin which in
previous versions never set sample_fmt.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 028a3a1532..b61fb75274 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -585,6 +585,8 @@ int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec) if (avctx->codec->encode) { int i; if (avctx->codec->sample_fmts) { + if (avctx->sample_fmt == AV_SAMPLE_FMT_NONE) + avctx->sample_fmt = AV_SAMPLE_FMT_S16; for (i = 0; avctx->codec->sample_fmts[i] != AV_SAMPLE_FMT_NONE; i++) if (avctx->sample_fmt == avctx->codec->sample_fmts[i]) break; |