Fixed some sound and threading issues.

Details:
* Switched SDL audio mutex to RW lock. This fixes games that continiously call SetVolume in a different thread (like Ghostbusters)
* Added contition to buffer audio packets independent of video packets. This fixes choppy audio across many games.
* Increased the number of audio frame buffers from 2 to 4. Just in case.
* Migrated to std::jthread and std::mutex from pthreads.
* Fixed a race condition with joins on avplayer close that caused a crash.
This commit is contained in:
Vladislav Mikhalin 2024-08-14 21:30:44 +03:00
parent e33ff10212
commit 0d6e8e227a
17 changed files with 231 additions and 481 deletions

View file

@ -5,6 +5,7 @@
#include "common/types.h"
#include <stdarg.h> // va_list
#include <stddef.h> // size_t
namespace Core::Loader {