Corrections
This commit is contained in:
parent
a3a94a5f8c
commit
7becd3d30c
@ -42,7 +42,7 @@ dependencies {
|
||||
implementation("org.json:json:20210307")
|
||||
|
||||
implementation("no.iktdev:exfl:0.0.13-SNAPSHOT")
|
||||
implementation("no.iktdev.library:subtitle:1.7.8-SNAPSHOT")
|
||||
implementation("no.iktdev.library:subtitle:1.7.9-SNAPSHOT")
|
||||
|
||||
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1")
|
||||
|
||||
@ -181,14 +181,14 @@ class EncodeArgumentCreatorTask(@Autowired override var coordinator: Coordinator
|
||||
}
|
||||
}
|
||||
|
||||
private class AudioArguments(
|
||||
class AudioArguments(
|
||||
val audioStream: AudioStream,
|
||||
val allStreams: ParsedMediaStreams,
|
||||
val preference: AudioPreference
|
||||
) {
|
||||
fun isAudioCodecEqual() = audioStream.codec_name.lowercase() == preference.codec.lowercase()
|
||||
private fun shouldUseEAC3(): Boolean {
|
||||
return (preference.defaultToEAC3OnSurroundDetected && audioStream.channels > 2 && audioStream.codec_name.lowercase() != "eac3")
|
||||
return (preference.defaultToEAC3OnSurroundDetected && audioStream.channels > 2 && audioStream.codec_name.lowercase() == "eac3")
|
||||
}
|
||||
|
||||
fun getAudioArguments(): AudioArgumentsDto {
|
||||
@ -196,7 +196,11 @@ class EncodeArgumentCreatorTask(@Autowired override var coordinator: Coordinator
|
||||
val codecParams = if (shouldUseEAC3())
|
||||
listOf("-c:a", "eac3")
|
||||
else if (!isAudioCodecEqual()) {
|
||||
listOf("-c:a", preference.codec)
|
||||
val codecSwap = mutableListOf("-c:a", preference.codec)
|
||||
if (audioStream.channels > 2 && !preference.preserveChannels) {
|
||||
codecSwap.addAll(listOf("-ac", "2"))
|
||||
}
|
||||
codecSwap
|
||||
} else
|
||||
listOf("-acodec", "copy")
|
||||
return AudioArgumentsDto(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user