cleanup
This commit is contained in:
+17
-12
@@ -386,9 +386,15 @@ bool RageSound::GetDataToPlay( int16_t *buffer, int size, int &sound_frame, int
|
|||||||
int got_frames = GetData( (char *) buffer, size );
|
int got_frames = GetData( (char *) buffer, size );
|
||||||
if( !got_frames )
|
if( !got_frames )
|
||||||
{
|
{
|
||||||
/* We're at the end of the data. If we're looping, rewind and restart. */
|
/* EOF. */
|
||||||
if( GetStopMode() == RageSoundParams::M_LOOP )
|
switch( GetStopMode() )
|
||||||
{
|
{
|
||||||
|
case RageSoundParams::M_STOP:
|
||||||
|
/* Not looping. Normally, we'll just stop here. */
|
||||||
|
return false;
|
||||||
|
|
||||||
|
case RageSoundParams::M_LOOP:
|
||||||
|
/* Rewind and restart. */
|
||||||
NumRewindsThisCall++;
|
NumRewindsThisCall++;
|
||||||
if(NumRewindsThisCall > 3)
|
if(NumRewindsThisCall > 3)
|
||||||
{
|
{
|
||||||
@@ -418,18 +424,17 @@ bool RageSound::GetDataToPlay( int16_t *buffer, int size, int &sound_frame, int
|
|||||||
/* Stop here. */
|
/* Stop here. */
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
case RageSoundParams::M_CONTINUE:
|
||||||
|
/* Keep playing silence. */
|
||||||
|
memset( buffer, 0, size*framesize );
|
||||||
|
got_frames = size;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
ASSERT(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Not looping. Normally, we'll just stop here. */
|
|
||||||
if( GetStopMode() == RageSoundParams::M_STOP )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
/* We're out of data, but we're not going to stop, so fill in the
|
|
||||||
* rest with silence. */
|
|
||||||
memset( buffer, 0, size*framesize );
|
|
||||||
got_frames = size;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This block goes from position to position+got_frames. */
|
/* This block goes from position to position+got_frames. */
|
||||||
|
|||||||
Reference in New Issue
Block a user