From 7571b94a24287003ed85663bd7db5fa8bb79f2fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20K=C3=BCnzel?= Date: Mon, 11 May 2026 01:30:46 +0200 Subject: [PATCH 1/2] Fix and enable rtaudio module with MSVC --- CMakePresets.json | 2 +- src/modules/rtaudio/CMakeLists.txt | 2 +- src/modules/rtaudio/consumer_rtaudio.cpp | 4 ++++ src/msvc/gettimeofday.h | 8 ++++++++ vcpkg.json | 1 + 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 9aae31c0a..567a139e5 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -30,7 +30,7 @@ "MOD_SOX": "OFF", "MOD_GLAXNIMATE_QT6": "ON", "MOD_RESAMPLE": "OFF", - "MOD_RTAUDIO": "OFF", + "MOD_RTAUDIO": "ON", "MOD_RUBBERBAND": "ON", "MOD_SDL2": "ON", "MOD_SPATIALAUDIO": "OFF", diff --git a/src/modules/rtaudio/CMakeLists.txt b/src/modules/rtaudio/CMakeLists.txt index b7e05f3f7..1a3817b97 100644 --- a/src/modules/rtaudio/CMakeLists.txt +++ b/src/modules/rtaudio/CMakeLists.txt @@ -13,7 +13,7 @@ target_include_directories(mltrtaudio PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(mltrtaudio PRIVATE mlt Threads::Threads) if(MSVC) - target_link_libraries(mltrtaudio PRIVATE PThreads4W::PThreads4W) + target_link_libraries(mltrtaudio PRIVATE PThreads4W::PThreads4W msvccompat) endif() if(TARGET PkgConfig::rtaudio) diff --git a/src/modules/rtaudio/consumer_rtaudio.cpp b/src/modules/rtaudio/consumer_rtaudio.cpp index 488051acf..216c55468 100644 --- a/src/modules/rtaudio/consumer_rtaudio.cpp +++ b/src/modules/rtaudio/consumer_rtaudio.cpp @@ -21,7 +21,11 @@ #include #include #include +#ifdef _MSC_VER +#include +#else #include +#endif #ifdef USE_INTERNAL_RTAUDIO #include "RtAudio.h" #else diff --git a/src/msvc/gettimeofday.h b/src/msvc/gettimeofday.h index 131896693..b0149cf3b 100644 --- a/src/msvc/gettimeofday.h +++ b/src/msvc/gettimeofday.h @@ -12,8 +12,16 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + int gettimeofday(struct timeval *tp, struct timezone *tzp); +#ifdef __cplusplus +} +#endif + #endif /* _MSC_VER */ #endif /* _MY_GETTIMEOFDAY_H_ */ diff --git a/vcpkg.json b/vcpkg.json index 91baf624d..f4452b962 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -22,6 +22,7 @@ "pthreads", "qtbase", "qtsvg", + "rtaudio", "rubberband", "sdl2", "frei0r" From d1a7c57c3201cee0f3db3ffe11135cb8060e6c21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20K=C3=BCnzel?= Date: Mon, 11 May 2026 01:35:36 +0200 Subject: [PATCH 2/2] Enable resample module with MSVC --- CMakePresets.json | 2 +- vcpkg.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index 567a139e5..250469aef 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -29,7 +29,7 @@ "MOD_QT6": "ON", "MOD_SOX": "OFF", "MOD_GLAXNIMATE_QT6": "ON", - "MOD_RESAMPLE": "OFF", + "MOD_RESAMPLE": "ON", "MOD_RTAUDIO": "ON", "MOD_RUBBERBAND": "ON", "MOD_SDL2": "ON", diff --git a/vcpkg.json b/vcpkg.json index f4452b962..53c48da5c 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -10,6 +10,7 @@ "libebur128", "libexif", "libiconv", + "libsamplerate", "libvorbis", "libxml2", {