diff --git a/stream/mts/encoder.go b/stream/mts/encoder.go index a33d3447..2fd17176 100644 --- a/stream/mts/encoder.go +++ b/stream/mts/encoder.go @@ -220,9 +220,9 @@ func (e *Encoder) Write(nalu []byte) (int, error) { pkt.PCR = e.pcr() pusi = false } - n, err := e.dst.Write(pkt.Bytes(e.tsSpace[:PacketSize])) + _, err := e.dst.Write(pkt.Bytes(e.tsSpace[:PacketSize])) if err != nil { - return n, err + return len(nalu), err } e.pktCount++ }