From 751dca7091aeaa74750b3959c5a474fed4a3d979 Mon Sep 17 00:00:00 2001 From: CDrummond Date: Wed, 5 Mar 2025 17:58:19 +0000 Subject: [PATCH] Enable DSF support for libav builds --- ChangeLog | 7 +++++-- src/analyse.rs | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9099f1e..f1427e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,13 +3,16 @@ 1. Add support for (DSD) WavPack - thanks to Bart Lauret 2. Update version of bliss library. 3. Use 'ffmpeg' commandline to decode files, and not ffmpeg libraries by - defualt. Pass "--features=libav" to cargo to build against ffmpeg - libraries. + defualt. Pass '--features=libav' to cargo to build against ffmpeg + libraries. Pass '--features=libav,libavstatic' to cargo to build against + ffmpeg libraries, and statically link these in. 4. Add ability to specify LMS JSONRPC port. 5. If new files analysed and 'ignore' file exists then update DB's 'ignore' flags. 6. Add option to write analysis results to files, and use for future scans. 7. If log level set to 'trace' then set this level for the Bliss library too. +8. Enable support for '.dsf' files, but only if compiled against ffmpeg + libraries. 0.2.3 ----- diff --git a/src/analyse.rs b/src/analyse.rs index 882282e..61d8aa4 100644 --- a/src/analyse.rs +++ b/src/analyse.rs @@ -40,6 +40,10 @@ use bliss_audio::{decoder::Decoder, BlissResult, Song}; const DONT_ANALYSE: &str = ".notmusic"; const MAX_ERRORS_TO_SHOW: usize = 100; const MAX_TAG_ERRORS_TO_SHOW: usize = 50; + +#[cfg(feature = "libav")] +const VALID_EXTENSIONS: [&str; 7] = ["m4a", "mp3", "ogg", "flac", "opus", "wv", "dsf"]; +#[cfg(not(feature = "libav"))] const VALID_EXTENSIONS: [&str; 6] = ["m4a", "mp3", "ogg", "flac", "opus", "wv"]; fn get_file_list(db: &mut db::Db, mpath: &Path, path: &Path, track_paths: &mut Vec, cue_tracks:&mut Vec, file_count:&mut usize, max_num_files: usize, use_tags: bool, tagged_file_count:&mut usize, dry_run: bool) { @@ -201,7 +205,8 @@ fn analyse_new_files(db: &db::Db, mpath: &PathBuf, track_paths: Vec, max album: track.album.unwrap_or_default().to_string(), album_artist: track.album_artist.unwrap_or_default().to_string(), genre: track.genre.unwrap_or_default().to_string(), - duration: track.duration.as_secs() as u32 + duration: track.duration.as_secs() as u32, + analysis: None }; // Remove prefix from audio_file_path