fix error handling for mono sounds
This commit is contained in:
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user