[FFmpeg-cvslog] For FFmpeg 0.7 branch: Treat AV_SAMPLE_FMT_NONE as S16 for encoders.
Reimar Döffinger
git at videolan.org
Tue Jul 26 22:35:17 CEST 2011
ffmpeg | branch: release/0.7 | Reimar Döffinger <Reimar.Doeffinger at gmx.de> | Tue Jul 26 21:58:10 2011 +0200| [dcf1830a15a1e9ad1e16086369d55d8cb3a14e83] | committer: Reimar Döffinger
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 at gmx.de>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dcf1830a15a1e9ad1e16086369d55d8cb3a14e83
---
libavcodec/utils.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 028a3a1..b61fb75 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;
More information about the ffmpeg-cvslog
mailing list