Move keyframe handling to the sender side.

This is simpler and gets rid of ErrKeyframeNeeded.
This commit is contained in:
Juliusz Chroboczek
2021-05-11 22:36:56 +02:00
parent b2ea8e8533
commit c52e1f4ce0
5 changed files with 59 additions and 108 deletions
+2 -2
View File
@@ -458,7 +458,7 @@ func (t *diskTrack) WriteRTP(packet *rtp.Packet) error {
sample, ts := t.builder.PopWithTimestamp()
if sample == nil {
if kfNeeded {
return conn.ErrKeyframeNeeded
t.remote.RequestKeyframe()
}
return nil
}
@@ -506,7 +506,7 @@ func (t *diskTrack) WriteRTP(packet *rtp.Packet) error {
if t.writer == nil {
if !keyframe {
return conn.ErrKeyframeNeeded
t.remote.RequestKeyframe()
}
return nil
}