aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-07-26 21:58:10 +0200
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-07-26 21:58:10 +0200
commitdcf1830a15a1e9ad1e16086369d55d8cb3a14e83 (patch)
tree3651bd8e7001dc7b94a8912cf3742c0716b851ae
parent0a48a67e57873b938c49ca57b0629e3e33fe37db (diff)
downloadffmpeg-dcf1830a15a1e9ad1e16086369d55d8cb3a14e83.tar.gz
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>
-rw-r--r--libavcodec/utils.c2
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;