Don't encode on copy

This commit is contained in:
Tiberiu Ichim 2026-02-14 21:17:52 +02:00
parent 96707200b8
commit 98ce898f41
3 changed files with 150 additions and 3 deletions

View file

@ -444,9 +444,7 @@ async function mergeAudioFiles(audioTracks, duration, itemCachePath, outputFileP
const audioCodec = encodingOptions.codec || 'aac'
const audioChannels = encodingOptions.channels || 2
// TODO: Updated in 2.2.11 to always encode even if merging multiple m4b. This is because just using the file extension as was being done before is not enough. This can be an option or do more to check if a concat is possible.
// const audioRequiresEncode = audioTracks[0].metadata.ext !== '.m4b'
const audioRequiresEncode = true
const audioRequiresEncode = audioCodec !== 'copy'
const firstTrackIsM4b = audioTracks[0].metadata.ext.toLowerCase() === '.m4b'
const isOneTrack = audioTracks.length === 1