simplify: remove RageSound::Fail

This commit is contained in:
Glenn Maynard
2006-12-23 04:16:21 +00:00
parent 9873757c06
commit 76e3f6a14a
2 changed files with 6 additions and 10 deletions
+6 -9
View File
@@ -140,13 +140,6 @@ bool RageSound::IsLoaded() const
return m_pSource != NULL;
}
void RageSound::Fail( RString sReason )
{
LOG->Warn( "Decoding %s failed: %s", GetLoadedFilePath().c_str(), sReason.c_str() );
m_sError = sReason;
}
class RageSoundReader_Silence: public RageSoundReader
{
public:
@@ -290,7 +283,10 @@ int RageSound::GetDataToPlay( int16_t *pBuffer, int iFrames, int64_t &iStreamFra
int iGotFrames = m_pSource->RetriedRead( pDest + (iFramesStored * framesize), iFrames, &iSourceFrame, &fRate );
if( iGotFrames == RageSoundReader::ERROR )
Fail( m_pSource->GetError() );
{
m_sError = m_pSource->GetError();
LOG->Warn( "Decoding %s failed: %s", GetLoadedFilePath().c_str(), m_sError.c_str() );
}
if( iGotFrames < 0 )
{
@@ -562,7 +558,8 @@ bool RageSound::SetPositionFrames( int iFrames )
int iRet = m_pSource->SetPosition( iFrames );
if( iRet == -1 )
{
Fail( m_pSource->GetError() );
m_sError = m_pSource->GetError();
LOG->Warn( "SetPositionFrames: seek %s failed: %s", GetLoadedFilePath().c_str(), m_sError.c_str() );
return false; /* failed */
}
-1
View File
@@ -183,7 +183,6 @@ private:
int64_t GetPositionSecondsInternal( bool *bApproximate = NULL, RageTimer *pTimer = NULL ) const;
bool SetPositionFrames( int frames = -1 );
void Fail( RString sReason );
RageSoundParams::StopMode_t GetStopMode() const; /* resolves M_AUTO */
void SoundIsFinishedPlaying(); // called by sound drivers