Commit 0c8df661 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Don't drop first frame when recording to disk.

parent c8de6620
......@@ -221,12 +221,22 @@ func newDiskConn(directory, label string, up conn.Up, remoteTracks []conn.UpTrac
var builder *samplebuilder.SampleBuilder
switch remote.Codec().Name {
case webrtc.Opus:
builder = samplebuilder.New(128, &codecs.OpusPacket{})
builder = samplebuilder.New(
16, &codecs.OpusPacket{},
samplebuilder.WithPartitionHeadChecker(
&codecs.OpusPartitionHeadChecker{},
),
)
case webrtc.VP8:
if conn.hasVideo {
return nil, errors.New("multiple video tracks not supported")
}
builder = samplebuilder.New(128, &codecs.VP8Packet{})
builder = samplebuilder.New(
128, &codecs.VP8Packet{},
samplebuilder.WithPartitionHeadChecker(
&codecs.VP8PartitionHeadChecker{},
),
)
conn.hasVideo = true
}
track := &diskTrack{
......
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