mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-26 07:43:36 +01:00
Allow mono atrac3 for "game menu backgrund audio". Fix possible data race.
This commit is contained in:
1 parent
8ab0a3cf7c
commit
682472c5b5
3 files changed
+10
-3
No files matched your search
@@ -80,7 +80,7 @@ public:
|
||||
|
||||
raw_data_ = (uint8_t *)malloc(numBytes);
|
||||
raw_data_size_ = numBytes;
|
||||
if (/*raw_bytes_per_frame_ == 280 && */ num_channels == 2) {
|
||||
if (/*raw_bytes_per_frame_ == 280 && */ num_channels == 1 || num_channels == 2) {
|
||||
file_.readData(raw_data_, numBytes);
|
||||
} else {
|
||||
ELOG("Error - bad blockalign or channels");
|
||||
@@ -174,6 +174,7 @@ static void ClearBackgroundAudio() {
|
||||
at3Reader = 0;
|
||||
}
|
||||
playbackOffset = 0;
|
||||
gameLastChanged = 0;
|
||||
}
|
||||
|
||||
void SetBackgroundAudioGame(const std::string &path) {
|
||||
@@ -210,6 +211,11 @@ int PlayBackgroundAudio() {
|
||||
if (!gameInfo)
|
||||
return 0;
|
||||
|
||||
if (gameInfo->pending) {
|
||||
// Should try again shortly..
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (gameInfo->sndFileData.size()) {
|
||||
const std::string &data = gameInfo->sndFileData;
|
||||
at3Reader = new AT3PlusReader(data);
|
||||
|
||||
Reference in new issue
Block a user