container/mts/mpegts_test.go: writePSI and writeFrame take bytes.Buffer pointer now

This commit is contained in:
Saxon 2019-05-10 17:47:48 +09:30
parent b12a78dad2
commit 62844809f2
1 changed files with 4 additions and 4 deletions

View File

@ -33,7 +33,7 @@ func TestGetPTSRange(t *testing.T) {
var clip bytes.Buffer
// Write the PSI first.
err := writePSI(clip)
err := writePSI(&clip)
if err != nil {
t.Fatalf("did not expect error writing psi: %v", err)
}
@ -43,7 +43,7 @@ func TestGetPTSRange(t *testing.T) {
for _, frame := range frames {
nextPTS := curTime * ptsFreq
err = writeFrame(clip, frame, uint64(nextPTS))
err = writeFrame(&clip, frame, uint64(nextPTS))
if err != nil {
t.Fatalf("did not expect error writing frame: %v", err)
}
@ -63,7 +63,7 @@ func TestGetPTSRange(t *testing.T) {
}
// writePSI is a helper function write the PSI found at the start of a clip.
func writePSI(b bytes.Buffer) error {
func writePSI(b *bytes.Buffer) error {
// Write PAT.
pat := Packet{
PUSI: true,
@ -95,7 +95,7 @@ func writePSI(b bytes.Buffer) error {
// writeFrame is a helper function used to form a PES packet from a frame, and
// then fragment this across MPEGTS packets where they are then written to the
// given buffer.
func writeFrame(b bytes.Buffer, frame []byte, pts uint64) error {
func writeFrame(b *bytes.Buffer, frame []byte, pts uint64) error {
// Prepare PES data.
pesPkt := pes.Packet{
StreamID: videoStreamID,