API update
This commit is contained in:
@@ -78,8 +78,8 @@ bool RageSound_OSS::GetData()
|
||||
static SoundMixBuffer mix;
|
||||
mix.SetVolume( SOUNDMAN->GetMixVolume() );
|
||||
|
||||
const int play_pos = last_cursor_pos;
|
||||
const int cur_play_pos = GetPosition( NULL /* doesn't care */);
|
||||
const int64_t play_pos = last_cursor_pos;
|
||||
const int64_t cur_play_pos = GetPosition( NULL /* doesn't care */);
|
||||
|
||||
for(unsigned i = 0; i < sounds.size(); ++i)
|
||||
{
|
||||
@@ -92,11 +92,11 @@ bool RageSound_OSS::GetData()
|
||||
if( !sounds[i]->start_time.IsZero() )
|
||||
{
|
||||
/* If the sound is supposed to start at a time past this buffer, insert silence. */
|
||||
const int iFramesUntilThisBuffer = play_pos - cur_play_pos;
|
||||
const int64_t iFramesUntilThisBuffer = play_pos - cur_play_pos;
|
||||
const float fSecondsBeforeStart = -sounds[i]->start_time.Ago();
|
||||
const int iFramesBeforeStart = int(fSecondsBeforeStart * samplerate);
|
||||
const int iSilentFramesInThisBuffer = iFramesBeforeStart-iFramesUntilThisBuffer;
|
||||
const int iSilentBytesInThisBuffer = clamp( iSilentFramesInThisBuffer * bytes_per_frame, 0, bytes_left );
|
||||
const int64_t iFramesBeforeStart = int64_t(fSecondsBeforeStart * samplerate);
|
||||
const int64_t iSilentFramesInThisBuffer = iFramesBeforeStart-iFramesUntilThisBuffer;
|
||||
const int iSilentBytesInThisBuffer = clamp( int(iSilentFramesInThisBuffer * bytes_per_frame), 0, bytes_left );
|
||||
|
||||
memset( buf+bytes_read, 0, iSilentBytesInThisBuffer );
|
||||
bytes_read += iSilentBytesInThisBuffer;
|
||||
@@ -180,7 +180,7 @@ void RageSound_OSS::StopMixing(RageSoundBase *snd)
|
||||
sounds.erase(sounds.begin()+i, sounds.begin()+i+1);
|
||||
}
|
||||
|
||||
int RageSound_OSS::GetPosition(const RageSoundBase *snd) const
|
||||
int64_t RageSound_OSS::GetPosition(const RageSoundBase *snd) const
|
||||
{
|
||||
LockMutex L(SOUNDMAN->lock);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user