Skip to content

Commit 8b3734e

Browse files
xdrudisedaniels
authored andcommitted
Revert "Adapt an existing test to provide coverage"
This reverts commit dbe26d3.
1 parent 0ae39fd commit 8b3734e

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

pkg/media/ivfwriter/ivfwriter_test.go

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ package ivfwriter
55

66
import (
77
"bytes"
8-
"encoding/binary"
98
"io"
109
"testing"
1110

@@ -258,25 +257,19 @@ func TestIVFWriter_AV1(t *testing.T) {
258257
t.Run("Unfragmented", func(t *testing.T) {
259258
buffer := &bytes.Buffer{}
260259

261-
expectedTimestamp := uint32(3653407706)
260+
writer, err := NewWith(buffer, WithCodec(mimeTypeAV1))
261+
assert.NoError(t, err)
262262

263-
// the timestamp is an uint32, 4 bytes from offset 36
264-
expectedPayloadWithTimestamp := []byte{
263+
assert.NoError(t, writer.WriteRTP(&rtp.Packet{Payload: []byte{0x00, 0x01, 0xFF}}))
264+
assert.NoError(t, writer.Close())
265+
assert.Equal(t, buffer.Bytes(), []byte{
265266
0x44, 0x4b, 0x49, 0x46, 0x0, 0x0, 0x20,
266267
0x0, 0x41, 0x56, 0x30, 0x31, 0x80, 0x2,
267268
0xe0, 0x1, 0x1e, 0x0, 0x0, 0x0, 0x1, 0x0,
268269
0x0, 0x0, 0x84, 0x3, 0x0, 0x0, 0x0, 0x0,
269-
0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0xda, 0x93, 0xc2,
270-
0xd9, 0x0, 0x0, 0x0, 0x0, 0xff,
271-
}
272-
273-
writer, err := NewWith(buffer, WithCodec(mimeTypeAV1))
274-
assert.NoError(t, err)
275-
276-
assert.NoError(t, writer.WriteRTP(&rtp.Packet{Header: rtp.Header{Timestamp: expectedTimestamp}, Payload: []byte{0x00, 0x01, 0xFF}}))
277-
assert.NoError(t, writer.Close())
278-
assert.Equal(t, expectedPayloadWithTimestamp, buffer.Bytes())
279-
assert.Equal(t, expectedTimestamp, binary.LittleEndian.Uint32(expectedPayloadWithTimestamp[36:40]))
270+
0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
271+
0x0, 0x0, 0x0, 0x0, 0x0, 0xff,
272+
})
280273
})
281274

282275
t.Run("Fragmented", func(t *testing.T) {

0 commit comments

Comments
 (0)