fix error handling for mono sounds

This commit is contained in:
Glenn Maynard
2004-11-14 20:21:04 +00:00
parent 09b14c370e
commit 8770ff7c8d
+6 -6
View File
@@ -326,12 +326,6 @@ int RageSound::FillBuf( int frames )
if(cnt == 0)
return got_something; /* EOF */
if( Sample->GetNumChannels() == 1 )
{
RageSoundUtil::ConvertMonoToStereoInPlace( (int16_t *) inbuf, cnt / sizeof(int16_t) );
cnt *= 2;
}
if(cnt == -1)
{
Fail(Sample->GetError());
@@ -340,6 +334,12 @@ int RageSound::FillBuf( int frames )
return 0;
}
if( Sample->GetNumChannels() == 1 )
{
RageSoundUtil::ConvertMonoToStereoInPlace( (int16_t *) inbuf, cnt / sizeof(int16_t) );
cnt *= 2;
}
RateChange( inbuf, cnt, m_Param.speed_input_samples, m_Param.speed_output_samples, channels );
/* Add the data to the buffer. */