From b8fefc6a0dd7d4bebba385d57a7ae43313d7ccdc Mon Sep 17 00:00:00 2001 From: Rich Gerber Date: Tue, 26 Oct 2021 11:47:46 -0700 Subject: [PATCH] Change Int32 to long for BitRate --- FFMpegCore/FFProbe/MediaAnalysis.cs | 9 ++++++--- FFMpegCore/FFProbe/MediaStream.cs | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/FFMpegCore/FFProbe/MediaAnalysis.cs b/FFMpegCore/FFProbe/MediaAnalysis.cs index f7338cc..a2db068 100644 --- a/FFMpegCore/FFProbe/MediaAnalysis.cs +++ b/FFMpegCore/FFProbe/MediaAnalysis.cs @@ -52,7 +52,7 @@ private VideoStream ParseVideoStream(FFProbeStream stream) { Index = stream.Index, AvgFrameRate = MediaAnalysisUtils.DivideRatio(MediaAnalysisUtils.ParseRatioDouble(stream.AvgFrameRate, '/')), - BitRate = !string.IsNullOrEmpty(stream.BitRate) ? MediaAnalysisUtils.ParseIntInvariant(stream.BitRate) : default, + BitRate = !string.IsNullOrEmpty(stream.BitRate) ? MediaAnalysisUtils.ParseLongInvariant(stream.BitRate) : default, BitsPerRawSample = !string.IsNullOrEmpty(stream.BitsPerRawSample) ? MediaAnalysisUtils.ParseIntInvariant(stream.BitsPerRawSample) : default, CodecName = stream.CodecName, CodecLongName = stream.CodecLongName, @@ -77,7 +77,7 @@ private AudioStream ParseAudioStream(FFProbeStream stream) return new AudioStream { Index = stream.Index, - BitRate = !string.IsNullOrEmpty(stream.BitRate) ? MediaAnalysisUtils.ParseIntInvariant(stream.BitRate) : default, + BitRate = !string.IsNullOrEmpty(stream.BitRate) ? MediaAnalysisUtils.ParseLongInvariant(stream.BitRate) : default, CodecName = stream.CodecName, CodecLongName = stream.CodecLongName, CodecTag = stream.CodecTag, @@ -98,7 +98,7 @@ private SubtitleStream ParseSubtitleStream(FFProbeStream stream) return new SubtitleStream { Index = stream.Index, - BitRate = !string.IsNullOrEmpty(stream.BitRate) ? MediaAnalysisUtils.ParseIntInvariant(stream.BitRate) : default, + BitRate = !string.IsNullOrEmpty(stream.BitRate) ? MediaAnalysisUtils.ParseLongInvariant(stream.BitRate) : default, CodecName = stream.CodecName, CodecLongName = stream.CodecLongName, Duration = MediaAnalysisUtils.ParseDuration(stream), @@ -135,6 +135,9 @@ public static double ParseDoubleInvariant(string line) => public static int ParseIntInvariant(string line) => int.Parse(line, System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture); + public static long ParseLongInvariant(string line) => + long.Parse(line, System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture); + public static TimeSpan ParseDuration(string duration) { diff --git a/FFMpegCore/FFProbe/MediaStream.cs b/FFMpegCore/FFProbe/MediaStream.cs index 7d6ad20..68bc78f 100644 --- a/FFMpegCore/FFProbe/MediaStream.cs +++ b/FFMpegCore/FFProbe/MediaStream.cs @@ -12,7 +12,7 @@ public class MediaStream public string CodecLongName { get; internal set; } = null!; public string CodecTagString { get; set; } = null!; public string CodecTag { get; set; } = null!; - public int BitRate { get; internal set; } + public long BitRate { get; internal set; } public TimeSpan Duration { get; internal set; } public string? Language { get; internal set; } public Dictionary? Disposition { get; internal set; }