|
|
|
|
@ -71,7 +71,7 @@ const details = () => ({
|
|
|
|
|
if (languages.includes(file.ffProbeData.streams[i].tags.language)) {
|
|
|
|
|
// mark the id of the first track in lang
|
|
|
|
|
if (firstAudioInLangIdx === -1) {
|
|
|
|
|
response.infoLog += `☒Audio stream 0:a:${audioIdx} set as firstAudioInLangIdx`
|
|
|
|
|
response.infoLog += `☒Audio stream 0:a:${audioIdx} set as firstAudioInLangIdx \n`
|
|
|
|
|
firstAudioInLangIdx = audioIdx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -86,15 +86,15 @@ const details = () => ({
|
|
|
|
|
for (let i = 0; i < defaults.length; i++) {
|
|
|
|
|
if (firstAudioInLangIdx === -1) {
|
|
|
|
|
// we never found an audio track in lang, just break
|
|
|
|
|
response.infoLog += `☒No audio stream in preferred lang was found`
|
|
|
|
|
response.infoLog += `☒No audio stream in preferred lang was found \n`
|
|
|
|
|
break;
|
|
|
|
|
} else if (firstAudioInLangIdx === i && defaults[i] === 0) {
|
|
|
|
|
} else if (firstAudioInLangIdx === i && defaults[i]) {
|
|
|
|
|
convert = true;
|
|
|
|
|
ffmpegCommandInsert += `-disposition:a:${i} default `;
|
|
|
|
|
response.infoLog += `☒Audio stream 0:a:${i} is the first track in preferred language and not currently default; setting as default. \n`;
|
|
|
|
|
} else if (firstAudioInLangIdx === i && defaults[i] === 1) {
|
|
|
|
|
} else if (firstAudioInLangIdx === i && defaults[i]) {
|
|
|
|
|
response.infoLog += `☒Audio stream 0:a:${i} is the first track in preferred language and alrady default. \n`;
|
|
|
|
|
} else if (defaults[i] === 1) {
|
|
|
|
|
} else if (defaults[i]) {
|
|
|
|
|
convert = true;
|
|
|
|
|
ffmpegCommandInsert += `-disposition:a:${i} 0 `;
|
|
|
|
|
response.infoLog += `☒Audio stream 0:a:${i} is overlapping with new default audio track; removing disposition. \n`;
|
|
|
|
|
|