fix(videochannel): ignore vp8 missing reference errors

This commit is contained in:
zarazaex69
2026-05-27 07:54:33 +03:00
parent 8ca59975c3
commit 0a5d3fb922
3 changed files with 9 additions and 3 deletions
@@ -1,6 +1,7 @@
package videochannel
import (
"errors"
"fmt"
"sync"
"sync/atomic"
@@ -73,6 +74,11 @@ func (d *goDecoder) PushSample(sample []byte) error {
}
frame, err := d.dec.Decode(sample)
if err != nil {
// Inter-frame arrived before any keyframe (e.g. SFU started forwarding
// mid-GOP). Drop silently; the next keyframe will reset the reference.
if errors.Is(err, vp8.ErrNoReference) {
return nil
}
return fmt.Errorf("vp8 decode: %w", err)
}
gray := frame.Grayscale()