mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-10-26 16:45:09 +00:00
Add test for keyframe duration overshoot clamping
This commit is contained in:
1 parent
8044156df5
commit
9f5f18d2db
1 file changed
+9
-2
@@ -15,10 +15,17 @@ namespace Jellyfin.MediaEncoding.Hls.Tests.Playlist
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ComputeSegments_InvalidDuration_ThrowsArgumentException()
|
||||
public void ComputeSegments_ZeroDurationOvershoot_ClampsToDuration()
|
||||
{
|
||||
var keyframeData = new KeyframeData(0, new[] { MsToTicks(10000) });
|
||||
Assert.Throws<ArgumentException>(() => DynamicHlsPlaylistGenerator.ComputeSegments(keyframeData, 6000));
|
||||
Assert.Equal(new[] { 10.0 }, DynamicHlsPlaylistGenerator.ComputeSegments(keyframeData, 6000));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ComputeSegments_MinorDurationOvershoot_ClampsToDuration()
|
||||
{
|
||||
var keyframeData = new KeyframeData(MsToTicks(9900), new[] { 0L, MsToTicks(5000), MsToTicks(10000) });
|
||||
Assert.Equal(new[] { 10.0 }, DynamicHlsPlaylistGenerator.ComputeSegments(keyframeData, 6000));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
||||
Reference in new issue
Block a user