stream/mts: fixed what encoder is doing with Write methods int return

This commit is contained in:
Saxon 2019-03-14 11:41:37 +10:30
parent 61d70dc9a6
commit 89ba74004a
1 changed files with 2 additions and 2 deletions

View File

@ -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++
}