Fix: don't chop off the first 26ms of each MP3 (but don't change sync,

either).
This commit is contained in:
Glenn Maynard
2003-10-02 04:56:09 +00:00
parent 0115900378
commit 036fd2beb9
9 changed files with 35 additions and 4 deletions
+10 -2
View File
@@ -520,7 +520,7 @@ void RageSound::StopPlaying()
if(!playing)
return;
stopped_position = GetPositionSeconds();
stopped_position = GetPositionSecondsInternal();
/* Tell the sound manager to stop mixing this sound. */
SOUNDMAN->StopMixing(this);
@@ -555,7 +555,8 @@ float RageSound::GetLengthSeconds()
return len / 1000.f; /* ms -> secs */
}
float RageSound::GetPositionSeconds() const
/* Get the position, not counting GetOffsetFix. */
float RageSound::GetPositionSecondsInternal() const
{
LockMut(SOUNDMAN->lock);
@@ -624,6 +625,13 @@ float RageSound::GetPositionSeconds() const
return GetPlaybackRate() * closest_position / float(samplerate());
}
float RageSound::GetPositionSeconds() const
{
LOG->Trace("XXX fix %f", Sample->GetOffsetFix());
return GetPositionSecondsInternal() + Sample->GetOffsetFix();
}
bool RageSound::SetPositionSeconds( float fSeconds )
{
return SetPositionSamples( fSeconds == -1? -1: int(fSeconds * samplerate()) );