From 548b5cfbdf6f898f04561fc8ee8687e4128ef2bb Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Wed, 4 Mar 2026 10:51:01 -0800 Subject: [PATCH] Fix chromaprint C-level assertion crash on 5.1 surround FLAC files. Not possible to check --- core/acoustid_client.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/acoustid_client.py b/core/acoustid_client.py index bc08dc42..58680f8d 100644 --- a/core/acoustid_client.py +++ b/core/acoustid_client.py @@ -370,6 +370,18 @@ class AcoustIDClient: logger.warning(f"Cannot lookup: file not found: {audio_file}") return None + # Check channel count — chromaprint crashes (SIGABRT) on >2 channel files (e.g. 5.1 surround) + try: + from mutagen import File as MutagenFile + mf = MutagenFile(audio_file) + if mf and mf.info: + channels = getattr(mf.info, 'channels', 2) + if channels and channels > 2: + logger.warning(f"Skipping AcoustID: file has {channels} channels (surround audio): {audio_file}") + return None + except Exception as e: + logger.debug(f"Could not check channel count, proceeding anyway: {e}") + try: import acoustid