Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion codecs/vp8_packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
23 changes: 23 additions & 0 deletions codecs/vp8_packet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading