src/io/source_sndfile.c: fix resampled position in _seek
authorPaul Brossier <piem@piem.org>
Thu, 19 Dec 2013 22:03:57 +0000 (17:03 -0500)
committerPaul Brossier <piem@piem.org>
Thu, 19 Dec 2013 22:03:57 +0000 (17:03 -0500)
src/io/source_sndfile.c

index 0fa7fc5..359ab79 100644 (file)
@@ -263,7 +263,7 @@ uint_t aubio_source_sndfile_get_channels(aubio_source_sndfile_t * s) {
 }
 
 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);
 }