From 1baa066cf7317b2e89c35d59972d68d25a90fc6b Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Wed, 15 Dec 2021 06:07:37 +0000 Subject: [PATCH] disposition fix (#213) * disposition fix * Fix --- Community/Tdarr_Plugin_076a_re_order_audio_streams.js | 7 +++++-- Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Community/Tdarr_Plugin_076a_re_order_audio_streams.js b/Community/Tdarr_Plugin_076a_re_order_audio_streams.js index d7ecbf7..8186923 100644 --- a/Community/Tdarr_Plugin_076a_re_order_audio_streams.js +++ b/Community/Tdarr_Plugin_076a_re_order_audio_streams.js @@ -116,11 +116,14 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } } - ffmpegCommand += ` -map 0:a:${streamIdx} -disposition:a:${streamIdx} default`; + ffmpegCommand += ` -map 0:a:${streamIdx} -disposition:a:0 default`; for (var i = 0; i < allAudioTracks.length; i++) { if (i !== streamIdx) { - ffmpegCommand += ` -map 0:a:${i} -disposition:a:${i} none `; + ffmpegCommand += ` -map 0:a:${i} `; + } + if (i !== 0) { + ffmpegCommand += ` -disposition:a:${i} 0 `; } } diff --git a/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js b/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js index 30d8107..620cfea 100644 --- a/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js +++ b/Community/Tdarr_Plugin_076b_re_order_subtitle_streams.js @@ -119,11 +119,14 @@ const plugin = (file, librarySettings, inputs, otherArguments) => { } } - ffmpegCommand += ` -map 0:s:${streamIdx} -disposition:s:${streamIdx} default`; + ffmpegCommand += ` -map 0:s:${streamIdx} -disposition:s:0 default`; for (var i = 0; i < allSubtitleTracks.length; i++) { if (i !== streamIdx) { - ffmpegCommand += ` -map 0:s:${i} -disposition:a:${i} none `; + ffmpegCommand += ` -map 0:s:${i} `; + } + if (i !== 0) { + ffmpegCommand += ` -disposition:s:${i} 0 `; } }