http://bugs.winehq.org/show_bug.cgi?id=14717
Andrew Eikum aeikum@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #38064|0 |1 is obsolete| | Attachment #38100|0 |1 is obsolete| |
--- Comment #256 from Andrew Eikum aeikum@codeweavers.com 2011-12-30 15:27:31 CST --- Created attachment 38186 --> http://bugs.winehq.org/attachment.cgi?id=38186 Speex-based resampler patchset, improved positioning
(In reply to comment #253)
Andrew, your resampler produces clicks. To test: run foobar2000 and play a wav file with the sample rate of 11025 Hz. And there is also a bug with 24-bit dsb support: sign extension has to happen in get(), not in put().
Indeed it did. I'm fairly certain it was due to the double-counting issue you mentioned in comment 248. I think input samples were being used twice, but didn't completely confirm that.
So here's another patchset, based on yours from comment 254. It contains a first draft of a patch which removes the position conversions from primary to secondary buffer, and instead has the secondary buffers maintain their position independently. Then we only advance the secondary buffer by the number of samples that Speex actually converted, fixing the double count issue. It fixes the click problem -- or at least, the one I noticed using your instructions.
I'm still suspicious of the primary_mixpos member. It seems redundant, but I'm not totally convinced yet. I'll give it a closer look on Monday. It would also be nice to confirm that converting fewer frames than requested doesn't cause problems (it shouldn't due to the prebuffer, I think, but this should be verified).