Commit a183ac4b authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Increase the size of the diskwriter's reordering buffer.

This must be larger than the samplebuilder's MaxLate.
parent a2ce7035
...@@ -634,11 +634,22 @@ func (conn *diskConn) initWriter(width, height uint32) error { ...@@ -634,11 +634,22 @@ func (conn *diskConn) initWriter(width, height uint32) error {
return err return err
} }
interceptor, err := mkvcore.NewMultiTrackBlockSorter(
// must be larger than the samplebuilder's MaxLate.
mkvcore.WithMaxDelayedPackets(384),
mkvcore.WithSortRule(mkvcore.BlockSorterDropOutdated),
)
if err != nil {
conn.file.Close()
conn.file = nil
return err
}
ws, err := mkvcore.NewSimpleBlockWriter( ws, err := mkvcore.NewSimpleBlockWriter(
conn.file, desc, conn.file, desc,
mkvcore.WithEBMLHeader(header), mkvcore.WithEBMLHeader(header),
mkvcore.WithSegmentInfo(webm.DefaultSegmentInfo), mkvcore.WithSegmentInfo(webm.DefaultSegmentInfo),
mkvcore.WithBlockInterceptor(webm.DefaultBlockInterceptor), mkvcore.WithBlockInterceptor(interceptor),
) )
if err != nil { if err != nil {
conn.file.Close() conn.file.Close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment