Commit ddafca57 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Decrease keyframe interval when writing to disk.

parent f53276b8
...@@ -359,10 +359,9 @@ func (t *diskTrack) WriteRTP(packet *rtp.Packet) error { ...@@ -359,10 +359,9 @@ func (t *diskTrack) WriteRTP(packet *rtp.Packet) error {
} }
t.lastKf = ts t.lastKf = ts
} else if t.writer != nil { } else if t.writer != nil {
// Request a keyframe every 10s // Request a keyframe every 4s
delta := ts - t.lastKf delta := ts - t.lastKf
if (delta&0x80000000) == 0 && if (delta&0x80000000) != 0 || delta > 4*90000 {
delta > 10*90000 {
kfNeeded = true kfNeeded = true
} }
} }
......
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