fix for no audio stream video

pull/4432/head
nyanmisaka 4 years ago
parent 6987cb8357
commit 11c74cb65c

@ -1429,6 +1429,11 @@ namespace Jellyfin.Api.Controllers
private string GetAudioArguments(StreamState state, EncodingOptions encodingOptions)
{
if (state.AudioStream == null)
{
return string.Empty;
}
var audioCodec = _encodingHelper.GetAudioEncoder(state);
if (!state.IsOutputVideo)

@ -1518,6 +1518,11 @@ namespace MediaBrowser.Controller.MediaEncoding
/// <returns>System.Nullable{System.Int32}.</returns>
public int? GetNumAudioChannelsParam(EncodingJobInfo state, MediaStream audioStream, string outputAudioCodec)
{
if (audioStream == null)
{
return null;
}
var request = state.BaseRequest;
var inputChannels = audioStream?.Channels;

@ -593,6 +593,11 @@ namespace MediaBrowser.Controller.MediaEncoding
{
get
{
if (VideoStream == null)
{
return null;
}
if (EncodingHelper.IsCopyCodec(OutputVideoCodec))
{
return VideoStream?.Codec;
@ -606,6 +611,11 @@ namespace MediaBrowser.Controller.MediaEncoding
{
get
{
if (AudioStream == null)
{
return null;
}
if (EncodingHelper.IsCopyCodec(OutputAudioCodec))
{
return AudioStream?.Codec;

Loading…
Cancel
Save