mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Fixed seeking. In theory.
This commit is contained in:
@@ -150,9 +150,19 @@ namespace lullaby
|
||||
|
||||
bool Mpg123Decoder::seek(float s)
|
||||
{
|
||||
off_t r = mpg123_seek(handle, (off_t)(s*1000.0f), SEEK_SET);
|
||||
off_t offset = mpg123_timeframe(handle, s);
|
||||
|
||||
return (r >= 0);
|
||||
if(offset < 0)
|
||||
return false;
|
||||
|
||||
if(mpg123_feedseek(handle, 0, SEEK_SET, &offset) >= 0)
|
||||
{
|
||||
data_offset = offset;
|
||||
eof = false;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Mpg123Decoder::rewind()
|
||||
|
||||
Reference in New Issue
Block a user