summaryrefslogtreecommitdiffstats
path: root/src/audio/sampman_oal.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2021-07-23 23:47:04 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2021-07-23 23:47:04 +0200
commita7e673c2ec6a5ed25f3bae8caab90e2113158c03 (patch)
tree8c88859a32b0613a4c28fd1a0432504403e5a5e6 /src/audio/sampman_oal.cpp
parentfix premake (diff)
downloadre3-a7e673c2ec6a5ed25f3bae8caab90e2113158c03.tar
re3-a7e673c2ec6a5ed25f3bae8caab90e2113158c03.tar.gz
re3-a7e673c2ec6a5ed25f3bae8caab90e2113158c03.tar.bz2
re3-a7e673c2ec6a5ed25f3bae8caab90e2113158c03.tar.lz
re3-a7e673c2ec6a5ed25f3bae8caab90e2113158c03.tar.xz
re3-a7e673c2ec6a5ed25f3bae8caab90e2113158c03.tar.zst
re3-a7e673c2ec6a5ed25f3bae8caab90e2113158c03.zip
Diffstat (limited to 'src/audio/sampman_oal.cpp')
-rw-r--r--src/audio/sampman_oal.cpp39
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)