Cleanup.
This commit is contained in:
@@ -653,6 +653,19 @@ RageSoundReader_MP3::RageSoundReader_MP3()
|
||||
mad_stream_init( &mad->Stream );
|
||||
mad_frame_init( &mad->Frame );
|
||||
mad_synth_init( &mad->Synth );
|
||||
|
||||
mad_frame_mute( &mad->Frame );
|
||||
mad_timer_reset( &mad->Timer );
|
||||
mad->length = -1;
|
||||
mad->inbuf_filepos = 0;
|
||||
mad->header_bytes = 0;
|
||||
mad->has_xing = false;
|
||||
mad->timer_accurate = 1;
|
||||
mad->bitrate = -1;
|
||||
mad->first_frame = true;
|
||||
|
||||
for(int i = 0; i < 200; ++i)
|
||||
mad->toc[i] = -1;
|
||||
}
|
||||
|
||||
RageSoundReader_MP3::~RageSoundReader_MP3()
|
||||
@@ -672,19 +685,6 @@ SoundReader_FileReader::OpenResult RageSoundReader_MP3::Open( CString filename_
|
||||
rw = fopen(filename, "rb");
|
||||
ASSERT( rw );
|
||||
|
||||
mad_frame_mute( &mad->Frame );
|
||||
mad_timer_reset( &mad->Timer );
|
||||
mad->length = -1;
|
||||
mad->inbuf_filepos = 0;
|
||||
mad->header_bytes = 0;
|
||||
mad->has_xing = false;
|
||||
mad->timer_accurate = 1;
|
||||
mad->bitrate = -1;
|
||||
mad->first_frame = true;
|
||||
|
||||
for(int i = 0; i < 200; ++i)
|
||||
mad->toc[i] = -1;
|
||||
|
||||
int ret = fseek( this->rw, 0, SEEK_END );
|
||||
ASSERT( ret != -1 );
|
||||
mad->filesize = ftell( this->rw );
|
||||
@@ -731,6 +731,15 @@ SoundReader_FileReader::OpenResult RageSoundReader_MP3::Open( CString filename_
|
||||
return OPEN_OK;
|
||||
}
|
||||
|
||||
|
||||
SoundReader *RageSoundReader_MP3::Copy() const
|
||||
{
|
||||
RageSoundReader_MP3 *ret = new RageSoundReader_MP3;
|
||||
ret->Open( filename );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* dst and src are buffers of 16-bit samples. len is the number of bytes
|
||||
* to copy from src. len must be even. */
|
||||
static void mono_to_stereo( char *dst, const char *src, unsigned len )
|
||||
@@ -1076,13 +1085,6 @@ int RageSoundReader_MP3::GetLengthConst( bool fast ) const
|
||||
return length;
|
||||
}
|
||||
|
||||
SoundReader *RageSoundReader_MP3::Copy() const
|
||||
{
|
||||
RageSoundReader_MP3 *ret = new RageSoundReader_MP3;
|
||||
ret->Open( filename );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user