diff --git a/.github/workflows/filter_by_cdb.js b/.github/workflows/filter_by_cdb.js index 29225f9267..df04be531c 100644 --- a/.github/workflows/filter_by_cdb.js +++ b/.github/workflows/filter_by_cdb.js @@ -12,9 +12,11 @@ const excludes = [ let result = []; -const cdbFile = path.join(__dirname, '../../build/compile_commands.json'); +const cdbFile = path.join(__dirname, '../../native/build/compile_commands.json'); +//IMPORTANT!!!!: console.log is the stdout of this script. if (fs.existsSync(cdbFile)) { const db = JSON.parse(fs.readFileSync(cdbFile, { encoding: 'utf8' })); + for (let f of ARGS) { const name = f.endsWith('.h') ? f.slice(0, -2) : f; // ignore .h extension name if (excludes.some((e) => name.includes(e))) continue; diff --git a/native/.github/workflows/filter_by_cdb.js b/native/.github/workflows/filter_by_cdb.js index 29225f9267..440bd33f90 100644 --- a/native/.github/workflows/filter_by_cdb.js +++ b/native/.github/workflows/filter_by_cdb.js @@ -13,6 +13,7 @@ const excludes = [ let result = []; const cdbFile = path.join(__dirname, '../../build/compile_commands.json'); + if (fs.existsSync(cdbFile)) { const db = JSON.parse(fs.readFileSync(cdbFile, { encoding: 'utf8' })); for (let f of ARGS) { diff --git a/native/cocos/audio/apple/AudioMacros.h b/native/cocos/audio/apple/AudioMacros.h index 21e05b8d12..9c8b8598cd 100644 --- a/native/cocos/audio/apple/AudioMacros.h +++ b/native/cocos/audio/apple/AudioMacros.h @@ -26,7 +26,7 @@ #pragma once -#define QUEUEBUFFER_NUM (3) +#define QUEUEBUFFER_NUM (4) #define QUEUEBUFFER_TIME_STEP (0.05f) #define QUOTEME_(x) #x diff --git a/native/cocos/audio/apple/AudioPlayer.mm b/native/cocos/audio/apple/AudioPlayer.mm index fe91eb8b0f..a66c2adeaf 100644 --- a/native/cocos/audio/apple/AudioPlayer.mm +++ b/native/cocos/audio/apple/AudioPlayer.mm @@ -244,7 +244,12 @@ void AudioPlayer::rotateBufferThread(int offsetFrame) { while (!_isDestroyed) { alGetSourcei(_alSource, AL_SOURCE_STATE, &sourceState); - if (sourceState == AL_PLAYING) { + /* On IOS, audio state will lie, when the system is not fully foreground, + * openAl will process the buffer in queue, but our condition cannot make sure that the audio + * is playing as it's too short. Interesting IOS system. + * Solution is to load buffer even if it's paused, just make sure that there's no bufferProcessed in + */ + if (sourceState == AL_PLAYING || sourceState == AL_PAUSED) { alGetSourcei(_alSource, AL_BUFFERS_PROCESSED, &bufferProcessed); while (bufferProcessed > 0) { bufferProcessed--;