diff options
| author | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2020-10-31 12:41:03 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-31 12:41:03 +0000 |
| commit | c54bdb4a0af1b132601b557ed2a9f4a76a4893cc (patch) | |
| tree | be6bc5bd549336584e3740ab9a4f3e8df5349de7 /MediaBrowser.Controller/MediaEncoding | |
| parent | 3ae37deea8a84edfc0281c984027f8a8145c7a9c (diff) | |
| parent | 4f320308f333507a324740248c7dd025085a7d67 (diff) | |
Merge pull request #86 from jellyfin/master
Updating from master
Diffstat (limited to 'MediaBrowser.Controller/MediaEncoding')
| -rw-r--r-- | MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 61340cd24..996b1b5c1 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -1380,24 +1380,40 @@ namespace MediaBrowser.Controller.MediaEncoding public int? GetAudioBitrateParam(BaseEncodingJobOptions request, MediaStream audioStream) { + if (audioStream == null) + { + return null; + } + if (request.AudioBitRate.HasValue) { // Don't encode any higher than this return Math.Min(384000, request.AudioBitRate.Value); } - return null; + // Empty bitrate area is not allow on iOS + // Default audio bitrate to 128K if it is not being requested + // https://ffmpeg.org/ffmpeg-codecs.html#toc-Codec-Options + return 128000; } public int? GetAudioBitrateParam(int? audioBitRate, MediaStream audioStream) { + if (audioStream == null) + { + return null; + } + if (audioBitRate.HasValue) { // Don't encode any higher than this return Math.Min(384000, audioBitRate.Value); } - return null; + // Empty bitrate area is not allow on iOS + // Default audio bitrate to 128K if it is not being requested + // https://ffmpeg.org/ffmpeg-codecs.html#toc-Codec-Options + return 128000; } public string GetAudioFilterParam(EncodingJobInfo state, EncodingOptions encodingOptions, bool isHls) |
