Fix null reference exception in ParseAudioStream

This commit is contained in:
Hmarik 2020-06-03 20:06:51 +03:00
parent 6e78af228a
commit 6b294ff510

View file

@ -67,7 +67,7 @@ private AudioStream ParseAudioStream(FFProbeStream stream)
CodecLongName = stream.CodecLongName,
Channels = stream.Channels ?? default,
ChannelLayout = stream.ChannelLayout,
Duration = TimeSpan.FromSeconds(ParseDoubleInvariant(stream.Duration ?? stream.Tags.Duration ?? "0")),
Duration = TimeSpan.FromSeconds(ParseDoubleInvariant(stream.Duration ?? stream.Tags?.Duration ?? "0")),
SampleRateHz = !string.IsNullOrEmpty(stream.SampleRate) ? ParseIntInvariant(stream.SampleRate) : default,
Language = stream.Tags?.Language
};