fix make_default_tracks_first duplicating streams

main
Gabe Farrell 9 months ago
parent 81fcc14301
commit 11228bd18e

@ -29,6 +29,8 @@ Sets the first audio stream as default. Removes all other default audio tracks'
Moves the default audio and default subtitle tracks to the first index, if they aren't there already. Moves the default audio and default subtitle tracks to the first index, if they aren't there already.
# Todo # Todo
- [x] Make_Default_Tracks_First will duplicate streams when more than one default exists. Make it quit instantly when the first track is already default to fix this.
- [ ] Give Anime_Subtitle_Fixer the option to set honorific tracks as default (enm language code or "honorific"/"weeb" in the title).
- [ ] Create a flow plugin to check if a file both has ASS/SSA subtitles, and does not have attached fonts - [ ] Create a flow plugin to check if a file both has ASS/SSA subtitles, and does not have attached fonts
- [ ] Create a flow plugin to check if a file has an audio track in a certain lang - [ ] Create a flow plugin to check if a file has an audio track in a certain lang
- [ ] Create a flow plugin to check if a file has embedded subtitle tracks - [ ] Create a flow plugin to check if a file has embedded subtitle tracks

@ -50,6 +50,8 @@ const details = () => ({
let processSubtitles = false; let processSubtitles = false;
let hasDefaultSubTrack = false; let hasDefaultSubTrack = false;
let hasDefaultAudioTrack = false; let hasDefaultAudioTrack = false;
let firstAudioTrackIsDefault = false;
let firstSubTrackIsDefault = false;
// [false, true, true] // [false, true, true]
@ -59,9 +61,10 @@ const details = () => ({
if (file.ffProbeData.streams[i].disposition.default === 1) { if (file.ffProbeData.streams[i].disposition.default === 1) {
hasDefaultAudioTrack = true; hasDefaultAudioTrack = true;
if (audioIdx === 0) { if (audioIdx === 0) {
firstAudioTrackIsDefault = true
response.infoLog += "☒Default audio stream is already first \n" response.infoLog += "☒Default audio stream is already first \n"
audioFfmpegInsert += "-map 0:a " audioFfmpegInsert += "-map 0:a "
} else { } else if (!firstAudioTrackIsDefault) {
convert = true; convert = true;
processAudio = true; processAudio = true;
defaultAudioIdx = audioIdx; defaultAudioIdx = audioIdx;
@ -74,9 +77,10 @@ const details = () => ({
if (file.ffProbeData.streams[i].disposition.default === 1) { if (file.ffProbeData.streams[i].disposition.default === 1) {
hasDefaultSubTrack = true; hasDefaultSubTrack = true;
if (subtitleIdx === 0) { if (subtitleIdx === 0) {
firstSubTrackIsDefault = true
response.infoLog += "☒Default subtitle stream is already first \n" response.infoLog += "☒Default subtitle stream is already first \n"
subtitleFfmpegInsert += "-map 0:s " subtitleFfmpegInsert += "-map 0:s "
} else { } else if (!firstSubTrackIsDefault) {
convert = true; convert = true;
processSubtitles = true; processSubtitles = true;
defaultSubtitleIdx = subtitleIdx; defaultSubtitleIdx = subtitleIdx;

Loading…
Cancel
Save