diff options
| author | Mayur Panchal <panchal.mayur2@gmail.com> | 2022-03-11 08:55:30 +1300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-10 20:55:30 +0100 |
| commit | 96de01ce016e26cd7ee9a3f128613458fa8f180e (patch) | |
| tree | f049f5c0b74f3e94d887070ce7f3d373dc06c9ab /tests | |
| parent | 388e0cba9f287952c5a57ae995519f0d02ee1f98 (diff) | |
ProbeResultNormalizer: fix framerate compare + tests (#7167)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs b/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs index 0fc8724b6..53e1550ed 100644 --- a/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs +++ b/tests/Jellyfin.MediaEncoding.Tests/Probing/ProbeResultNormalizerTests.cs @@ -31,6 +31,16 @@ namespace Jellyfin.MediaEncoding.Tests.Probing public void GetFrameRate_Success(string value, float? expected) => Assert.Equal(expected, ProbeResultNormalizer.GetFrameRate(value)); + [Theory] + [InlineData(0.5f, "0/1", false)] + [InlineData(24.5f, "8/196", false)] + [InlineData(63.5f, "1/127", true)] + [InlineData(null, "1/60", false)] + [InlineData(30f, "2/120", true)] + [InlineData(59.999996f, "1563/187560", true)] + public void IsCodecTimeBaseDoubleTheFrameRate_Success(float? frameRate, string codecTimeBase, bool expected) + => Assert.Equal(expected, ProbeResultNormalizer.IsCodecTimeBaseDoubleTheFrameRate(frameRate, codecTimeBase)); + [Fact] public void GetMediaInfo_MetaData_Success() { |
