Skip to content

Commit dbe024c

Browse files
committed
Sort chunk offsets before creating CO box
1 parent 1e9d979 commit dbe024c

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System.Threading.Tasks;
2+
3+
namespace AAXClean.FrameFilters.Video;
4+
5+
internal class VideoPassthrough : FrameFinalBase<FrameEntry>
6+
{
7+
protected override int InputBufferSize => 1;
8+
protected override Task FlushAsync() => Task.CompletedTask;
9+
protected override Task PerformFilteringAsync(FrameEntry input) => Task.CompletedTask;
10+
public override Task AddInputAsync(FrameEntry input)
11+
{
12+
return Task.CompletedTask;
13+
}
14+
}

src/Mpeg4Lib/Boxes/IChunkOffsets.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public static IChunkOffsets Create(StblBox stbl, ChunkOffsetList offsets)
99
{
1010
if (offsets.Count == 0)
1111
return StcoBox.CreateBlank(stbl, offsets);
12+
offsets.Sort();
1213
long maxOffset = offsets.GetOffsetAtIndex(offsets.Count - 1);
1314
return maxOffset > uint.MaxValue ? Co64Box.CreateBlank(stbl, offsets) : StcoBox.CreateBlank(stbl, offsets);
1415
}

0 commit comments

Comments
 (0)