Mercurial > mplayer.hg
comparison libaf/af_scaletempo.c @ 24897:d4a8f31df9ba
af_scaletempo: Fix audio copy position
Because of a missing *num_channels factor the filter copied audio from
an incorrect position. This mixed up the channel order and hurt audio
quality even if the channels had identical content.
author | uau |
---|---|
date | Thu, 01 Nov 2007 06:52:41 +0000 |
parents | 8133163bd1dd |
children | 0701957d2bf7 |
comparison
equal
deleted
inserted
replaced
24896:8133163bd1dd | 24897:d4a8f31df9ba |
---|---|
141 best_off = off; | 141 best_off = off; |
142 } | 142 } |
143 search_start += s->num_channels; | 143 search_start += s->num_channels; |
144 } | 144 } |
145 | 145 |
146 return best_off * 4; | 146 return best_off * 4 * s->num_channels; |
147 } | 147 } |
148 | 148 |
149 int _best_overlap_offset_s16(af_scaletempo_t* s) { | 149 int _best_overlap_offset_s16(af_scaletempo_t* s) { |
150 int32_t *pw, *ppc; | 150 int32_t *pw, *ppc; |
151 int16_t *po, *search_start; | 151 int16_t *po, *search_start; |
173 best_off = off; | 173 best_off = off; |
174 } | 174 } |
175 search_start += s->num_channels; | 175 search_start += s->num_channels; |
176 } | 176 } |
177 | 177 |
178 return best_off * 2; | 178 return best_off * 2 * s->num_channels; |
179 } | 179 } |
180 | 180 |
181 void _output_overlap_float(af_scaletempo_t* s, int8_t* buf_out, int bytes_off) { | 181 void _output_overlap_float(af_scaletempo_t* s, int8_t* buf_out, int bytes_off) { |
182 float* pout = (float*)buf_out; | 182 float* pout = (float*)buf_out; |
183 float* pb = (float*)s->table_blend; | 183 float* pb = (float*)s->table_blend; |