Browse Source

AudioFileReader: workarounds for wasm non-threaded behaviour

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.5.0
falkTX 2 years ago
parent
commit
cbc44a38dc
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 12 additions and 3 deletions
  1. +12
    -3
      source/native-plugins/audio-base.hpp

+ 12
- 3
source/native-plugins/audio-base.hpp View File

@@ -39,15 +39,19 @@ extern "C" {
# pragma GCC diagnostic pop
#endif

#ifdef CARLA_OS_WIN
#if defined(CARLA_OS_WIN)
# include <windows.h>
# define CARLA_MLOCK(ptr, size) VirtualLock((ptr), (size))
#else
#elif !defined(CARLA_OS_WASM)
# include <sys/mman.h>
# define CARLA_MLOCK(ptr, size) mlock((ptr), (size))
#else
# define CARLA_MLOCK(ptr, size)
#endif

// #define DEBUG_FILE_OPS
#ifdef CARLA_OS_WASM
# define DEBUG_FILE_OPS
#endif

typedef struct adinfo ADInfo;

@@ -341,6 +345,11 @@ public:

ad_dump_nfo(99, &fFileNfo);

#ifdef CARLA_OS_WASM
// FIXME pool handling with seeking and partial reads is failing
fFileNfo.can_seek = 0;
#endif

// Fix for misinformation using libsndfile
if (fFileNfo.frames % fFileNfo.channels)
--fFileNfo.frames;


Loading…
Cancel
Save