diff options
author | erorcun <erorcunerorcun@hotmail.com.tr> | 2021-02-03 21:12:55 +0100 |
---|---|---|
committer | erorcun <erorcunerorcun@hotmail.com.tr> | 2021-02-03 21:12:55 +0100 |
commit | c002dd6cbaf642f24b33fbc2be3fff765024ee09 (patch) | |
tree | 1a571a5fe1fd46bbb8c6f5fe7dc827bb6be87fef | |
parent | standalone windows links to premake (diff) | |
download | re3-c002dd6cbaf642f24b33fbc2be3fff765024ee09.tar re3-c002dd6cbaf642f24b33fbc2be3fff765024ee09.tar.gz re3-c002dd6cbaf642f24b33fbc2be3fff765024ee09.tar.bz2 re3-c002dd6cbaf642f24b33fbc2be3fff765024ee09.tar.lz re3-c002dd6cbaf642f24b33fbc2be3fff765024ee09.tar.xz re3-c002dd6cbaf642f24b33fbc2be3fff765024ee09.tar.zst re3-c002dd6cbaf642f24b33fbc2be3fff765024ee09.zip |
-rw-r--r-- | src/audio/sampman_oal.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp index 9365c7dd..d9adef5b 100644 --- a/src/audio/sampman_oal.cpp +++ b/src/audio/sampman_oal.cpp @@ -14,8 +14,6 @@ #include <AL/efx.h> #include <AL/efx-presets.h> -#pragma comment(lib, "OpenAL32.lib") - // for user MP3s #include <direct.h> #include <shlobj.h> @@ -24,6 +22,10 @@ #define _getcwd getcwd #endif +#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK +#pragma comment( lib, "OpenAL32.lib" ) +#endif + #include "common.h" #include "crossplatform.h" @@ -1872,6 +1874,9 @@ cSampleManager::StopStreamedFile(uint8 nStream) { delete stream; aStream[nStream] = NULL; + + if ( nStream == 0 ) + _bIsMp3Active = false; } } @@ -1884,7 +1889,21 @@ cSampleManager::GetStreamedFilePosition(uint8 nStream) if ( stream ) { - return stream->GetPosMS(); + if ( _bIsMp3Active ) + { + tMP3Entry *mp3 = _GetMP3EntryByIndex(_CurMP3Index); + + if ( mp3 != NULL ) + { + return stream->GetPosMS() + mp3->nTrackStreamPos; + } + else + return 0; + } + else + { + return stream->GetPosMS(); + } } return 0; |