diff --git a/codecs/vp8_packet.go b/codecs/vp8_packet.go index 569853c..f080532 100644 --- a/codecs/vp8_packet.go +++ b/codecs/vp8_packet.go @@ -39,7 +39,6 @@ func (p *VP8Payloader) Payload(mtu uint16, payload []byte) [][]byte { //nolint:c usingHeaderSize := vp8HeaderSize if p.EnablePictureID { switch { - case p.pictureID == 0: case p.pictureID < 128: usingHeaderSize = vp8HeaderSize + 2 default: diff --git a/codecs/vp8_packet_test.go b/codecs/vp8_packet_test.go index eb2d6cf..7b97946 100644 --- a/codecs/vp8_packet_test.go +++ b/codecs/vp8_packet_test.go @@ -143,6 +143,29 @@ func TestVP8Payloader_Payload(t *testing.T) { }, }, }, + "WithPictureID_wrap": { + payloader: VP8Payloader{ + EnablePictureID: true, + pictureID: 0x7FFF, + }, + mtu: 6, + payload: [][]byte{ + {0x90, 0x90}, + {0x91, 0x91}, + {0x92, 0x92}, + }, + expected: [][][]byte{ + { + {0x90, 0x80, 0xFF, 0xFF, 0x90, 0x90}, + }, + { + {0x90, 0x80, 0x00, 0x91, 0x91}, + }, + { + {0x90, 0x80, 0x01, 0x92, 0x92}, + }, + }, + }, } for name, testCase := range testCases { t.Run(name, func(t *testing.T) {