提交 0eaec105 编写于 作者: N Nikolai Zhubr 提交者: Michael Niedermayer

fixing overflow in 16->8 bit conversion, patch by (Nikolai Zhubr <s001 at hotbox dot ru>)

Originally committed as revision 913 to svn://svn.ffmpeg.org/ffmpeg/trunk
上级 b2a0a7fb
......@@ -209,14 +209,14 @@ static int pcm_encode_frame(AVCodecContext *avctx,
case CODEC_ID_PCM_S8:
for(;n>0;n--) {
v = *samples++;
dst[0] = (v + 128) >> 8;
dst[0] = v >> 8;
dst++;
}
break;
case CODEC_ID_PCM_U8:
for(;n>0;n--) {
v = *samples++;
dst[0] = ((v + 128) >> 8) + 128;
dst[0] = (v >> 8) + 128;
dst++;
}
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册