|
@@ -163,12 +163,12 @@ namespace lullaby
|
|
|
|
|
|
bool Mpg123Decoder::seek(float s)
|
|
bool Mpg123Decoder::seek(float s)
|
|
{
|
|
{
|
|
- off_t offset = mpg123_timeframe(handle, s);
|
|
|
|
|
|
+ off_t offset = s * sampleRate;
|
|
|
|
|
|
if(offset < 0)
|
|
if(offset < 0)
|
|
return false;
|
|
return false;
|
|
|
|
|
|
- if(mpg123_feedseek(handle, 0, SEEK_SET, &offset) >= 0)
|
|
|
|
|
|
+ if(mpg123_feedseek(handle, offset, SEEK_SET, &offset) >= 0)
|
|
{
|
|
{
|
|
data_offset = offset;
|
|
data_offset = offset;
|
|
eof = false;
|
|
eof = false;
|