Merge pull request #67 from HmarikBel/master

Fix null reference exception in ParseAudioStream
This commit is contained in:
Malte Rosenbjerg 2020-06-04 19:14:48 +02:00 committed by GitHub
commit 68709eeab1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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
};