From 8770ff7c8db685e9fa1aa5bdba634b765f360567 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 14 Nov 2004 20:21:04 +0000 Subject: [PATCH] fix error handling for mono sounds --- stepmania/src/RageSound.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/stepmania/src/RageSound.cpp b/stepmania/src/RageSound.cpp index 248b97eafd..483f1b1424 100644 --- a/stepmania/src/RageSound.cpp +++ b/stepmania/src/RageSound.cpp @@ -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. */