mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-26 00:04:43 +01:00
Merge pull request #17361 from IntelOrca/fix-ogg-freeze
Fix deadlock in AudioChannel and loop ride music
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
------------------------------------------------------------------------
|
||||
- Feature: [#16825] Add Alpine Coaster track type.
|
||||
- Feature: [#17011] Option to show ride vehicles as separate entries when selecting a ride to construct.
|
||||
- Feature: [#17217] Add FLAC and OGG/vorbis as supported audio formats for ride music objects.
|
||||
- Improved: [#7983] The red colour in the ride stat screen and the ride graphs now corresponds better to negative effects on a ride’s stats.
|
||||
- Improved: [#13966] Music Style dropdown is now sorted by name.
|
||||
- Improved: [#16978] Tree placement is more natural during map generation.
|
||||
|
||||
@@ -254,7 +254,7 @@ namespace OpenRCT2::Audio
|
||||
bytesRead += readLen;
|
||||
_offset += readLen;
|
||||
}
|
||||
if (_offset >= _source->GetLength())
|
||||
if (readLen == 0 || _offset >= _source->GetLength())
|
||||
{
|
||||
if (_loop == 0)
|
||||
{
|
||||
|
||||
@@ -226,7 +226,8 @@ namespace OpenRCT2::RideAudio
|
||||
auto source = audioContext->CreateStreamFromWAV(std::move(stream));
|
||||
if (source != nullptr)
|
||||
{
|
||||
auto channel = Mixer_Play_Music(source, MIXER_LOOP_NONE, true);
|
||||
auto shouldLoop = musicObj->GetTrackCount() == 1;
|
||||
auto channel = Mixer_Play_Music(source, shouldLoop ? MIXER_LOOP_INFINITE : MIXER_LOOP_NONE, true);
|
||||
if (channel != nullptr)
|
||||
{
|
||||
_musicChannels.emplace_back(instance, channel, source);
|
||||
|
||||
Reference in New Issue
Block a user