Set macOS encoder multiprocessing method to 'fork'

default for macOS python3 is 'spawn' which is not working with the current code
This commit is contained in:
AdeHub
2025-08-08 17:28:21 +12:00
parent d667cdb5c9
commit 0f43e8258d
2 changed files with 11 additions and 2 deletions

View File

@@ -1115,7 +1115,7 @@
<fieldset>
<div class="row checkbox left">
<input type="checkbox" class="bigcheck" name="osx_notify_enabled" id="osx_notify" value="1" ${config['osx_notify_enabled']} /><label for="osx_notify"><span class="option">MacOS</span></label>
<input type="checkbox" class="bigcheck" name="osx_notify_enabled" id="osx_notify" value="1" ${config['osx_notify_enabled']} /><label for="osx_notify"><span class="option">macOS</span></label>
</div>
<div id="osx_notify_options">
<div class="row checkbox">
@@ -1401,7 +1401,7 @@
libavselect = ''
%>
<div class="row">
<label title="Name of encoder to use. Lame, FFmpeg and libav are available for most Linux distributions. On Ubuntu, libav replaces FFmpeg. xld is OS X-only.">
<label title="Name of encoder to use. Lame, FFmpeg and libav are available for most Linux distributions. On Ubuntu, libav replaces FFmpeg. xld is macOS only.">
Encoder
</label>
<select name="encoder" id="encoder">

View File

@@ -160,6 +160,15 @@ def encode(albumPath):
# Use multicore if enabled
if headphones.CONFIG.ENCODER_MULTICORE:
# Set macOS multiprocessing method
try:
if headphones.SYS_PLATFORM == "darwin":
multiprocessing.set_start_method('fork')
except RuntimeError:
# Already set, ignore
pass
if headphones.CONFIG.ENCODER_MULTICORE_COUNT == 0:
processes = multiprocessing.cpu_count()
else: