Commit Graph

5 Commits

Author SHA1 Message Date
sukibaby 6f497f70e7 Use SetPosition_hard instead of SetPosition_toc for the mp3 position, remove dependency on accurate sync boolean
Resolves #610.

`RageSoundReader_MP3` has three different methods of setting the position. The default choice of `SetPosition_toc` is unable to provide an accurate result. The reason Edit Mode has such a severe desync when working with MP3's is due to the preference of using `SetPosition_toc`.

We can prevent this by using `SetPosition_hard` which works very well.  Judging by comments in the file, it seems like `SetPosition_hard` was too resource intensive to use as the default method, 20+ years ago.

The only downside is, if you start from an arbitrary position (which is **only** possible in Edit Mode), you have a few milliseconds of corrupted audio, but then the sync is perfect.  You can hear this in the demonstration video below.

When we start from the beginning of a file, such as playing a song, or using `Play whole song` in edit mode, `MADLIB_rewind` will be used.

`SetPosition_hard` provides an accurate result, and is consistent with the offset provided by `MADLIB_rewind`. The result is a consistent sync experience whether the MP3 is started from the beginning, or from an arbitrary position midway thru the file.

The `m_bAccurateSync` boolean dependency has been removed from SetPosition since it does not seem to provide any benefit on modern hardware. It seems fine to remove it so that we can call `MADLIB_rewind` or `SetPosition_hard` as fast as possible.

In my testing I never got `SetPosition_estimate` to be used, but I've left it in as a backup option.
2025-03-02 22:21:30 -08:00
Jason Felds 3d155c9970 NOW I start moving prototypes to headers?
I need to be more consistent...gah, hungry.
2011-06-12 19:35:24 -04:00
Jason Felds a085d0d1da Line endings...be normalized! 2011-03-17 01:47:30 -04:00
AJ Kelly 3e51544930 Initial commit. 2010-01-26 21:00:30 -06:00
Devin J. Pohly 80057f53cd smsvn -> ssc-hg glue: rearrange directory structure 2013-06-10 15:38:43 -04:00