diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-07-14 22:07:47 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-07-15 17:06:02 +0200 |
commit | 2ce36a48b92a21b88a59d08856751d9adc7a062f (patch) | |
tree | 153e2c8a5558bd743fab479d1599501771e0b329 /src/audio/sampman_oal.cpp | |
parent | Remove stupid cast (diff) | |
download | re3-2ce36a48b92a21b88a59d08856751d9adc7a062f.tar re3-2ce36a48b92a21b88a59d08856751d9adc7a062f.tar.gz re3-2ce36a48b92a21b88a59d08856751d9adc7a062f.tar.bz2 re3-2ce36a48b92a21b88a59d08856751d9adc7a062f.tar.lz re3-2ce36a48b92a21b88a59d08856751d9adc7a062f.tar.xz re3-2ce36a48b92a21b88a59d08856751d9adc7a062f.tar.zst re3-2ce36a48b92a21b88a59d08856751d9adc7a062f.zip |
Diffstat (limited to 'src/audio/sampman_oal.cpp')
-rw-r--r-- | src/audio/sampman_oal.cpp | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp index fdd449f7..2d9f9e86 100644 --- a/src/audio/sampman_oal.cpp +++ b/src/audio/sampman_oal.cpp @@ -894,7 +894,11 @@ cSampleManager::Initialise(void) for ( int32 i = 0; i < TOTAL_STREAMED_SOUNDS; i++ ) { - if ( aStream[0] && aStream[0]->Open(StreamedNameTable[i], IsThisTrackAt16KHz(i) ? 16000 : 32000) ) + if(aStream[0] && ( +#ifdef PS2_AUDIO_PATHS + aStream[0]->Open(PS2StreamedNameTable[i], IsThisTrackAt16KHz(i) ? 16000 : 32000) || +#endif + aStream[0]->Open(StreamedNameTable[i], IsThisTrackAt16KHz(i) ? 16000 : 32000))) { uint32 tatalms = aStream[0]->GetLengthMS(); aStream[0]->Close(); @@ -1601,8 +1605,6 @@ cSampleManager::StopChannel(uint32 nChannel) void cSampleManager::PreloadStreamedFile(uint8 nFile, uint8 nStream) { - char filename[MAX_PATH]; - ASSERT( nStream < MAX_STREAMS ); if ( nFile < TOTAL_STREAMED_SOUNDS ) @@ -1611,9 +1613,10 @@ cSampleManager::PreloadStreamedFile(uint8 nFile, uint8 nStream) stream->Close(); - strcpy(filename, StreamedNameTable[nFile]); - - stream->Open(filename, IsThisTrackAt16KHz(nFile) ? 16000 : 32000); +#ifdef PS2_AUDIO_PATHS + if(!stream->Open(PS2StreamedNameTable[nFile], IsThisTrackAt16KHz(nFile) ? 16000 : 32000)) +#endif + stream->Open(StreamedNameTable[nFile], IsThisTrackAt16KHz(nFile) ? 16000 : 32000); if ( !stream->Setup() ) { stream->Close(); @@ -1673,10 +1676,11 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream) // Try to continue from previous song, if already started if(!_GetMP3PosFromStreamPos(&position, &e) && !e) { nFile = 0; - strcpy(filename, StreamedNameTable[nFile]); - CStream *stream = aStream[nStream]; - stream->Open(filename, IsThisTrackAt16KHz(nFile) ? 16000 : 32000); +#ifdef PS2_AUDIO_PATHS + if(!stream->Open(PS2StreamedNameTable[nFile], IsThisTrackAt16KHz(nFile) ? 16000 : 32000)) +#endif + stream->Open(StreamedNameTable[nFile], IsThisTrackAt16KHz(nFile) ? 16000 : 32000); if ( stream->Setup() ) { if (position != 0) stream->SetPosMS(position); @@ -1725,10 +1729,11 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream) { nFile = 0; _bIsMp3Active = 0; - strcpy(filename, StreamedNameTable[nFile]); - - CStream* stream = aStream[nStream]; - stream->Open(filename, IsThisTrackAt16KHz(nFile) ? 16000 : 32000); + CStream *stream = aStream[nStream]; +#ifdef PS2_AUDIO_PATHS + if(!stream->Open(PS2StreamedNameTable[nFile], IsThisTrackAt16KHz(nFile) ? 16000 : 32000)) +#endif + stream->Open(StreamedNameTable[nFile], IsThisTrackAt16KHz(nFile) ? 16000 : 32000); if (stream->Setup()) { if (position != 0) @@ -1768,11 +1773,11 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream) position = 0; nFile = 0; } - strcpy(filename, StreamedNameTable[nFile]); - CStream *stream = aStream[nStream]; - - aStream[nStream]->Open(filename, IsThisTrackAt16KHz(nFile) ? 16000 : 32000); +#ifdef PS2_AUDIO_PATHS + if(!stream->Open(PS2StreamedNameTable[nFile], IsThisTrackAt16KHz(nFile) ? 16000 : 32000)) +#endif + stream->Open(StreamedNameTable[nFile], IsThisTrackAt16KHz(nFile) ? 16000 : 32000); if ( stream->Setup() ) { if (position != 0) |