Skip to content

Commit

Permalink
Fix MP3 "AccurateSync" seeking
Browse files Browse the repository at this point in the history
see comment within.
  • Loading branch information
poco0317 committed Sep 22, 2019
1 parent 8a09087 commit c7bc664
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/RageUtil/Sound/RageSoundReader_MP3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,14 @@ RageSoundReader_MP3::SetPosition(int iFrame)
if (ret <= 0)
return ret; /* it set the error */

// Documentation states that set_hard is meant for seeking forward.
// And we only use it when seeking accurately.
// By this logic, we can rewind without a care in the world.
// The result of doing this means we seek from the beginning of audio.
// ...And that means it's a fully accurate seek. Thank you and goodnight
// -poco
MADLIB_rewind();

/* Align exactly. */
return SetPosition_hard(iFrame);
} else {
Expand Down

0 comments on commit c7bc664

Please sign in to comment.