mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-16 15:16:41 +00:00
Merge pull request #7325 from eyezak/issue/6450
This commit is contained in:
@@ -1799,7 +1799,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
return false;
|
||||
}
|
||||
|
||||
return request.EnableAutoStreamCopy;
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool CanStreamCopyAudio(EncodingJobInfo state, MediaStream audioStream, IEnumerable<string> supportedAudioCodecs)
|
||||
@@ -1856,17 +1856,11 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
}
|
||||
|
||||
// Video bitrate must fall within requested value
|
||||
if (request.AudioBitRate.HasValue)
|
||||
if (request.AudioBitRate.HasValue
|
||||
&& audioStream.BitDepth.HasValue
|
||||
&& audioStream.BitRate.Value > request.AudioBitRate.Value)
|
||||
{
|
||||
if (!audioStream.BitRate.HasValue || audioStream.BitRate.Value <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (audioStream.BitRate.Value > request.AudioBitRate.Value)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return request.EnableAutoStreamCopy;
|
||||
|
||||
@@ -6,6 +6,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using Jellyfin.Data.Entities;
|
||||
using MediaBrowser.Model.Dlna;
|
||||
using MediaBrowser.Model.Drawing;
|
||||
@@ -23,7 +24,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
public int? OutputAudioBitrate;
|
||||
public int? OutputAudioChannels;
|
||||
|
||||
private TranscodeReason[] _transcodeReasons = null;
|
||||
private TranscodeReason? _transcodeReasons = null;
|
||||
|
||||
public EncodingJobInfo(TranscodingJobType jobType)
|
||||
{
|
||||
@@ -34,25 +35,23 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
SupportedSubtitleCodecs = Array.Empty<string>();
|
||||
}
|
||||
|
||||
public TranscodeReason[] TranscodeReasons
|
||||
public TranscodeReason TranscodeReason
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_transcodeReasons == null)
|
||||
if (!_transcodeReasons.HasValue)
|
||||
{
|
||||
if (BaseRequest.TranscodeReasons == null)
|
||||
{
|
||||
return Array.Empty<TranscodeReason>();
|
||||
_transcodeReasons = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
_transcodeReasons = BaseRequest.TranscodeReasons
|
||||
.Split(',')
|
||||
.Where(i => !string.IsNullOrEmpty(i))
|
||||
.Select(v => (TranscodeReason)Enum.Parse(typeof(TranscodeReason), v, true))
|
||||
.ToArray();
|
||||
_ = Enum.TryParse<TranscodeReason>(BaseRequest.TranscodeReasons, out var reason);
|
||||
_transcodeReasons = reason;
|
||||
}
|
||||
|
||||
return _transcodeReasons;
|
||||
return _transcodeReasons.Value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user