From 13564006399a300c404a846f903acf7ee9bbf5e0 Mon Sep 17 00:00:00 2001 From: Hans Dijkema Date: Tue, 28 Apr 2026 23:00:01 +0200 Subject: [PATCH] windows - needs to preload ffmpeg libraries --- ffmpeg-ffi.rkt | 12 ++++++++++++ play-test.rkt | 4 ++-- private/utils.rkt | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ffmpeg-ffi.rkt b/ffmpeg-ffi.rkt index b44cf63..8ebc535 100644 --- a/ffmpeg-ffi.rkt +++ b/ffmpeg-ffi.rkt @@ -17,6 +17,18 @@ ;; Adjust the names below if your shared library has another basename. ;; get-lib is used in the same style as libmpg123-ffi.rkt. + (when (eq? (system-type 'os) 'windows) + ; preload ffmpeg dlls. + (void + (begin + (get-lib '("avutil-60.dll") '(#f)) + (get-lib '("swresample-6.dll") '(#f)) + (get-lib '("avformat-62.dll") '(#f)) + (get-lib '("avcodec-62") '(#f)) + ) + ) + ) + (define lib (get-lib '("ffmpeg_audio" "libffmpeg_audio") '(#f))) (define-ffi-definer define-ffmpeg-audio lib diff --git a/play-test.rkt b/play-test.rkt index 79db44d..c26cbe3 100644 --- a/play-test.rkt +++ b/play-test.rkt @@ -19,8 +19,8 @@ (when (eq? os 'unix) ;(set! test-file3 "/muziek/Klassiek-Viool/Alina Ibragimova/Paganini_24 Caprices (2021)/24. 24 Caprices, Op 1 - No. 24 in A minor- Tema con variazioni. Quasi presto.flac") ;(set! test-file3 "/tmp/test.mp3") - (set! test-file3 (build-path tests "mahler-1.mp3")) - (set! test-file4 (build-path tests "mahler-2.mp3")) + (set! test-file3 (build-path tests "mahler-1.ogg")) + (set! test-file4 (build-path tests "mahler-2.ogg")) ) (when (eq? os 'windows) ;(set! test-file3 "C:\\Muziek\\Klassiek-Strijkkwartet\\Quatuor Zaïde\\Franz\\01 Erlkönig, D. 328 (Arr. For String Quartet by Eric Mouret).flac") diff --git a/private/utils.rkt b/private/utils.rkt index 1315e6d..0d3a6f1 100644 --- a/private/utils.rkt +++ b/private/utils.rkt @@ -73,7 +73,7 @@ (download-soundlibs)) (if (null? libs-to-try) (begin - (displayln (format "Warning: Cannot find library, tried ~a" orig-libs)) + (displayln (format "Warning: Cannot find library, tried ~a in ~a" orig-libs (build-lib-path))) #f) (ffi-lib (car libs-to-try) versions #:get-lib-dirs (λ () (cons (build-lib-path) (get-lib-search-dirs)))