mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-04 15:28:23 +00:00
update metadata editor
This commit is contained in:
parent
c3d6c19cc3
commit
718545a79b
24 changed files with 249 additions and 68 deletions
|
|
@ -326,26 +326,36 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
/// <returns>System.Nullable{System.Int32}.</returns>
|
||||
private int? GetNumAudioChannelsParam(EncodingJobOptions request, MediaStream audioStream, string outputAudioCodec)
|
||||
{
|
||||
if (audioStream != null)
|
||||
{
|
||||
var codec = outputAudioCodec ?? string.Empty;
|
||||
var inputChannels = audioStream == null
|
||||
? null
|
||||
: audioStream.Channels;
|
||||
|
||||
if (audioStream.Channels > 2 && codec.IndexOf("wma", StringComparison.OrdinalIgnoreCase) != -1)
|
||||
{
|
||||
// wmav2 currently only supports two channel output
|
||||
return 2;
|
||||
}
|
||||
if (inputChannels <= 0)
|
||||
{
|
||||
inputChannels = null;
|
||||
}
|
||||
|
||||
var codec = outputAudioCodec ?? string.Empty;
|
||||
|
||||
if (codec.IndexOf("wma", StringComparison.OrdinalIgnoreCase) != -1)
|
||||
{
|
||||
// wmav2 currently only supports two channel output
|
||||
return Math.Min(2, inputChannels ?? 2);
|
||||
}
|
||||
|
||||
if (request.MaxAudioChannels.HasValue)
|
||||
{
|
||||
if (audioStream != null && audioStream.Channels.HasValue)
|
||||
if (inputChannels.HasValue)
|
||||
{
|
||||
return Math.Min(request.MaxAudioChannels.Value, audioStream.Channels.Value);
|
||||
return Math.Min(request.MaxAudioChannels.Value, inputChannels.Value);
|
||||
}
|
||||
|
||||
var channelLimit = codec.IndexOf("mp3", StringComparison.OrdinalIgnoreCase) != -1
|
||||
? 2
|
||||
: 6;
|
||||
|
||||
// If we don't have any media info then limit it to 5 to prevent encoding errors due to asking for too many channels
|
||||
return Math.Min(request.MaxAudioChannels.Value, 5);
|
||||
return Math.Min(request.MaxAudioChannels.Value, channelLimit);
|
||||
}
|
||||
|
||||
return request.AudioChannels;
|
||||
|
|
@ -519,6 +529,11 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
return false;
|
||||
}
|
||||
|
||||
if (videoStream.IsAnamorphic ?? false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Can't stream copy if we're burning in subtitles
|
||||
if (request.SubtitleStreamIndex.HasValue)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue