From d6fbfab7b69268b16d0df6acea4e6b2c09de2d85 Mon Sep 17 00:00:00 2001 From: withmorten Date: Sun, 14 Feb 2021 16:03:15 +0100 Subject: update invite link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 52628982..45a40ee2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ reVC logo [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FGTAmodding%2Fre3%2Fbadge%3Fref%3Dmiami&style=flat)](https://actions-badge.atrox.dev/GTAmodding/re3/goto?ref=miami) - + ## Intro -- cgit v1.2.3 From 70b919137d7468404a34f20986de5fbf45352bf1 Mon Sep 17 00:00:00 2001 From: erorcun Date: Sun, 14 Feb 2021 18:07:21 +0300 Subject: (Test) Try to fix streams stop after a while --- src/audio/oal/stream.cpp | 11 ++++++++--- src/audio/oal/stream.h | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/audio/oal/stream.cpp b/src/audio/oal/stream.cpp index 4817d6d5..8f074fb4 100644 --- a/src/audio/oal/stream.cpp +++ b/src/audio/oal/stream.cpp @@ -1152,6 +1152,7 @@ void CStream::SetPan(uint8 nPan) m_nPan = nPan; } +// Should only be called if source is stopped void CStream::SetPosMS(uint32 nPos) { if ( !IsOpened() ) return; @@ -1234,12 +1235,16 @@ void CStream::ClearBuffers() alSourceUnqueueBuffers(m_pAlSources[1], 1, &value); } -bool CStream::Setup() +bool CStream::Setup(bool imSureQueueIsEmpty) { if ( IsOpened() ) { alSourcei(m_pAlSources[0], AL_LOOPING, AL_FALSE); alSourcei(m_pAlSources[1], AL_LOOPING, AL_FALSE); + if (!imSureQueueIsEmpty) { + SetPlay(false); + ClearBuffers(); + } m_pSoundFile->Seek(0); //SetPosition(0.0f, 0.0f, 0.0f); SetPitch(1.0f); @@ -1343,7 +1348,7 @@ void CStream::Update() // We should wait queue to be cleared to loop track, because position calculation relies on queue. if (m_nLoopCount != 1 && m_bActive && totalBuffers[0] == 0) { - Setup(); + Setup(true); buffersRefilled = FillBuffers() != 0; if (m_nLoopCount != 0) m_nLoopCount--; @@ -1376,7 +1381,7 @@ void CStream::ProviderInit() { if ( m_bReset ) { - if ( Setup() ) + if ( Setup(true) ) { SetPan(m_nPan); SetVolume(m_nVolume); diff --git a/src/audio/oal/stream.h b/src/audio/oal/stream.h index b3e96809..9a2a2fbe 100644 --- a/src/audio/oal/stream.h +++ b/src/audio/oal/stream.h @@ -100,7 +100,7 @@ public: uint32 GetPosMS(); uint32 GetLengthMS(); - bool Setup(); + bool Setup(bool imSureQueueIsEmpty = false); void Start(); void Stop(); void Update(void); -- cgit v1.2.3