RageSoundReader::Read(char *) -> int16_t *. This was originally

char * based on the idea of supporting more than one sample type.
I don't plan to do that (though I may change the sample type to float
or int32).
This commit is contained in:
Glenn Maynard
2007-01-20 01:10:24 +00:00
parent 29edd8be6c
commit fd4b5f93bb
29 changed files with 94 additions and 97 deletions
+4 -4
View File
@@ -160,7 +160,7 @@ int RageSoundReader_Vorbisfile::SetPosition( int iFrame )
return 1;
}
int RageSoundReader_Vorbisfile::Read( char *buf, int iFrames )
int RageSoundReader_Vorbisfile::Read( int16_t *buf, int iFrames )
{
int frames_read = 0;
@@ -201,9 +201,9 @@ int RageSoundReader_Vorbisfile::Read( char *buf, int iFrames )
{
int bstream;
#if defined(INTEGER_VORBIS)
ret = ov_read( vf, buf, iFrames * bytes_per_frame, &bstream );
ret = ov_read( vf, (char *) buf, iFrames * bytes_per_frame, &bstream );
#else // float vorbis decoder
ret = ov_read( vf, buf, iFrames * bytes_per_frame, (BYTE_ORDER == BIG_ENDIAN)?1:0, 2, 1, &bstream );
ret = ov_read( vf, (char *) buf, iFrames * bytes_per_frame, (BYTE_ORDER == BIG_ENDIAN)?1:0, 2, 1, &bstream );
#endif
{
vorbis_info *vi = ov_info( vf, -1 );
@@ -233,7 +233,7 @@ int RageSoundReader_Vorbisfile::Read( char *buf, int iFrames )
int iFramesRead = ret / bytes_per_frame;
read_offset += ret / bytes_per_frame;
buf += ret;
buf += ret / sizeof(int16_t);
frames_read += iFramesRead;
iFrames -= iFramesRead;
}