shithub: aubio

Download patch

ref: 6465d7f1b9176f86e7ad2fc73d6373d7338d1456
parent: 21234ee3fc5da2e92ac64d93a06cb71dd3aaeccd
author: Paul Brossier <piem@piem.org>
date: Thu Dec 19 12:03:57 EST 2013

src/io/source_sndfile.c: fix resampled position in _seek

--- a/src/io/source_sndfile.c
+++ b/src/io/source_sndfile.c
@@ -263,7 +263,7 @@
 }
 
 uint_t aubio_source_sndfile_seek (aubio_source_sndfile_t * s, uint_t pos) {
-  uint_t resampled_pos = (uint_t)ROUND(pos * s->input_samplerate * 1. / s->samplerate);
+  uint_t resampled_pos = (uint_t)ROUND(pos * s->ratio);
   return sf_seek (s->handle, resampled_pos, SEEK_SET);
 }
 
--