mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
seeking was broken in Mpg123Decoder
--HG-- branch : minor
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user