diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-25 03:14:27 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-25 03:30:12 +0200 |
commit | bacbbd2b03210f7e2faecb1b320a3e7e7a57b041 (patch) | |
tree | de271034ffd1f37e270ffbcee33bc97e2c10facf /libavformat/vocenc.c | |
parent | f15803e9578908e285b961efa0fc2fe1e10043d0 (diff) | |
download | ffmpeg-bacbbd2b03210f7e2faecb1b320a3e7e7a57b041.tar.gz |
vocenc: fix sample rate rounding direction
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/vocenc.c')
-rw-r--r-- | libavformat/vocenc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/vocenc.c b/libavformat/vocenc.c index beb72b8754..1ea4dbc5cb 100644 --- a/libavformat/vocenc.c +++ b/libavformat/vocenc.c @@ -64,13 +64,13 @@ static int voc_write_packet(AVFormatContext *s, AVPacket *pkt) if (s->streams[0]->codec->channels > 1) { avio_w8(pb, VOC_TYPE_EXTENDED); avio_wl24(pb, 4); - avio_wl16(pb, 65536-256000000/(enc->sample_rate*enc->channels)); + avio_wl16(pb, 65536-(256000000 + enc->sample_rate*enc->channels/2)/(enc->sample_rate*enc->channels)); avio_w8(pb, enc->codec_tag); avio_w8(pb, enc->channels - 1); } avio_w8(pb, VOC_TYPE_VOICE_DATA); avio_wl24(pb, pkt->size + 2); - avio_w8(pb, 256 - 1000000 / enc->sample_rate); + avio_w8(pb, 256 - (1000000 + enc->sample_rate/2) / enc->sample_rate); avio_w8(pb, enc->codec_tag); } voc->param_written = 1; |