harmless seek fix
This commit is contained in:
@@ -96,12 +96,21 @@ void RageSoundResampler::eof()
|
|||||||
{
|
{
|
||||||
ASSERT(!at_eof);
|
ASSERT(!at_eof);
|
||||||
|
|
||||||
/* Write some silence to flush out the real data. */
|
/* Write some silence to flush out the real data. If we don't have any sound,
|
||||||
const int size = channels*16;
|
* don't do this, so seeking past end of file doesn't write silence. */
|
||||||
Sint16 *data = new Sint16[size];
|
bool bNeedsFlush = false;
|
||||||
memset(data, 0, size * sizeof(Sint16));
|
for( int c = 0; c < channels; ++c )
|
||||||
write(data, size * sizeof(Sint16));
|
if( prev[c] != 0 )
|
||||||
delete [] data;
|
bNeedsFlush = true;
|
||||||
|
|
||||||
|
if( bNeedsFlush )
|
||||||
|
{
|
||||||
|
const int size = channels*16;
|
||||||
|
Sint16 *data = new Sint16[size];
|
||||||
|
memset(data, 0, size * sizeof(Sint16));
|
||||||
|
write(data, size * sizeof(Sint16));
|
||||||
|
delete [] data;
|
||||||
|
}
|
||||||
|
|
||||||
at_eof = true;
|
at_eof = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user