Check for pictureID existence in VP8 and VP9 (#4721)

* Check for pictureID existence in VP8 and VP9

* test
This commit is contained in:
Raja Subramanian
2026-08-03 15:22:59 +05:30
committed by GitHub
parent 4618b63eb7
commit 28468035d2
2 changed files with 9 additions and 1 deletions
+8 -1
View File
@@ -215,6 +215,10 @@ func (f *FrameRateCalculatorVP8) RecvPacket(ep *ExtPacket) bool {
f.logger.Debugw("no vp8 payload", "sn", ep.Packet.SequenceNumber)
return false
}
if !vp8.I {
f.logger.Debugw("no vp8 pictureID", "sn", ep.Packet.SequenceNumber)
return false
}
success := f.frameRateCalculatorVPx.RecvPacket(ep, vp8.PictureID)
if f.frameRateCalculatorVPx.Completed() {
@@ -262,7 +266,10 @@ func (f *FrameRateCalculatorVP9) RecvPacket(ep *ExtPacket) bool {
f.logger.Debugw("no vp9 payload", "sn", ep.Packet.SequenceNumber)
return false
}
if !vp9.I {
f.logger.Debugw("no vp9 pictureID", "sn", ep.Packet.SequenceNumber)
return false
}
if ep.Spatial < 0 || ep.Spatial >= int32(len(f.frameRateCalculatorsVPx)) || f.frameRateCalculatorsVPx[ep.Spatial] == nil {
f.logger.Debugw("invalid spatial layer", "sn", ep.Packet.SequenceNumber, "spatial", ep.Spatial)
return false
+1
View File
@@ -37,6 +37,7 @@ func (f *testFrameInfo) toVP8() *ExtPacket {
return &ExtPacket{
Packet: &rtp.Packet{Header: f.header},
Payload: codec.VP8{
I: true,
PictureID: f.framenumber,
},
VideoLayer: VideoLayer{Spatial: InvalidLayerSpatial, Temporal: int32(f.temporal)},