1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-22 23:50:00 +00:00

MP3 player fixes

This commit is contained in:
erorcun 2021-02-03 23:12:55 +03:00
parent f2cd511d9c
commit c002dd6cba

View file

@ -14,8 +14,6 @@
#include <AL/efx.h> #include <AL/efx.h>
#include <AL/efx-presets.h> #include <AL/efx-presets.h>
#pragma comment(lib, "OpenAL32.lib")
// for user MP3s // for user MP3s
#include <direct.h> #include <direct.h>
#include <shlobj.h> #include <shlobj.h>
@ -24,6 +22,10 @@
#define _getcwd getcwd #define _getcwd getcwd
#endif #endif
#if defined _MSC_VER && !defined CMAKE_NO_AUTOLINK
#pragma comment( lib, "OpenAL32.lib" )
#endif
#include "common.h" #include "common.h"
#include "crossplatform.h" #include "crossplatform.h"
@ -1872,6 +1874,9 @@ cSampleManager::StopStreamedFile(uint8 nStream)
{ {
delete stream; delete stream;
aStream[nStream] = NULL; aStream[nStream] = NULL;
if ( nStream == 0 )
_bIsMp3Active = false;
} }
} }
@ -1883,9 +1888,23 @@ cSampleManager::GetStreamedFilePosition(uint8 nStream)
CStream *stream = aStream[nStream]; CStream *stream = aStream[nStream];
if ( stream ) if ( stream )
{
if ( _bIsMp3Active )
{
tMP3Entry *mp3 = _GetMP3EntryByIndex(_CurMP3Index);
if ( mp3 != NULL )
{
return stream->GetPosMS() + mp3->nTrackStreamPos;
}
else
return 0;
}
else
{ {
return stream->GetPosMS(); return stream->GetPosMS();
} }
}
return 0; return 0;
} }