fix opus transcoding

This commit is contained in:
Luke Pulverenti 2016-03-05 13:29:32 -05:00
parent 62023e986a
commit 0aecb6e296
2 changed files with 12 additions and 4 deletions

View File

@ -73,10 +73,14 @@ namespace MediaBrowser.Api.Playback.Progressive
audioTranscodeParams.Add("-ac " + state.OutputAudioChannels.Value.ToString(UsCulture));
}
// opus will fail on 44100
if (!string.Equals(state.OutputAudioCodec, "opus", global::System.StringComparison.OrdinalIgnoreCase))
{
if (state.OutputAudioSampleRate.HasValue)
{
audioTranscodeParams.Add("-ar " + state.OutputAudioSampleRate.Value.ToString(UsCulture));
}
}
const string vn = " -vn";

View File

@ -35,10 +35,14 @@ namespace MediaBrowser.MediaEncoding.Encoder
audioTranscodeParams.Add("-ac " + state.OutputAudioChannels.Value.ToString(UsCulture));
}
// opus will fail on 44100
if (!string.Equals(state.OutputAudioCodec, "opus", StringComparison.OrdinalIgnoreCase))
{
if (state.OutputAudioSampleRate.HasValue)
{
audioTranscodeParams.Add("-ar " + state.OutputAudioSampleRate.Value.ToString(UsCulture));
}
}
const string vn = " -vn";