Move keyframe handling to the sender side.

This is simpler and gets rid of ErrKeyframeNeeded.
This commit is contained in:
Juliusz Chroboczek committed 2021-05-11 22:36:56 +02:00
1 parent b2ea8e8533
commit c52e1f4ce0
5 files changed
+59 -108

No files matched your search

+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
}