Merge pull request #12299 from gnattu/fix-ac4-samplerate-check

Fix AC-4 Sample rate check
pull/12309/head
Bond-009 7 months ago committed by GitHub
commit 2b0082bf15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1735,18 +1735,17 @@ public class DynamicHlsController : BaseJellyfinApiController
}
}
if (state.AudioStream is not null && state.AudioStream.CodecTag.Equals("ac-4", StringComparison.Ordinal))
if (state.OutputAudioSampleRate.HasValue)
{
args += " -ar " + state.OutputAudioSampleRate.Value.ToString(CultureInfo.InvariantCulture);
}
else if (state.AudioStream?.CodecTag is not null && state.AudioStream.CodecTag.Equals("ac-4", StringComparison.Ordinal))
{
// ac-4 audio tends to hava a super weird sample rate that will fail most encoders
// force resample it to 48KHz
args += " -ar 48000";
}
if (state.OutputAudioSampleRate.HasValue)
{
args += " -ar " + state.OutputAudioSampleRate.Value.ToString(CultureInfo.InvariantCulture);
}
args += _encodingHelper.GetAudioFilterParam(state, _encodingOptions);
return args;

Loading…
Cancel
Save