fix seeking with SetPosition_hard if the position lies in the first MP3 frame

This commit is contained in:
Glenn Maynard
2006-12-09 08:43:59 +00:00
parent c82cf0be7a
commit 1ba68d8469
+8 -4
View File
@@ -873,14 +873,18 @@ int RageSoundReader_MP3::SetPosition_hard( int iFrame )
if( mad_timer_compare(mad->Timer, desired) == 0 )
return 0;
/* If we're already past the requested position, rewind. */
if(mad_timer_compare(mad->Timer, desired) > 0)
MADLIB_rewind();
/* We always come in here with data synthed. Be careful not to synth the
* same frame twice. */
bool synthed=true;
/* If we're already past the requested position, rewind. */
if(mad_timer_compare(mad->Timer, desired) > 0)
{
MADLIB_rewind();
do_mad_frame_decode();
synthed = false;
}
/* Decode frames until the current frame contains the desired offset. */
while(1)
{