revid & stream/mts: fixed file headers regarding licensing location

This commit is contained in:
Saxon 2019-03-01 10:00:33 +10:30
parent baf033c281
commit ae4debd388
2 changed files with 10 additions and 9 deletions

View File

@ -24,7 +24,7 @@ LICENSE
for more details. for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with revid in gpl.txt. If not, see http://www.gnu.org/licenses. in gpl.txt. If not, see http://www.gnu.org/licenses.
*/ */
package revid package revid

View File

@ -140,6 +140,7 @@ type mtsSender struct {
discarded bool discarded bool
repairer *mts.DiscontinuityRepairer repairer *mts.DiscontinuityRepairer
chunk *ring.Chunk chunk *ring.Chunk
curPid int
} }
// newmtsSender returns a new mtsSender. // newmtsSender returns a new mtsSender.
@ -153,12 +154,6 @@ func newMtsSender(s sender, log func(lvl int8, msg string, args ...interface{}))
// load takes a *ring.Chunk and extracts bytes copying into s.pkt for use by the sender. // load takes a *ring.Chunk and extracts bytes copying into s.pkt for use by the sender.
func (s *mtsSender) load(c *ring.Chunk) error { func (s *mtsSender) load(c *ring.Chunk) error {
s.chunk = c s.chunk = c
return nil
}
// send checks the most recently loaded packet and if it is a PAT then the clip
// in s.buf is sent, otherwise the packet is added to s.buf.
func (s *mtsSender) send() error {
if s.next != nil { if s.next != nil {
s.buf = append(s.buf, s.next...) s.buf = append(s.buf, s.next...)
} }
@ -169,8 +164,14 @@ func (s *mtsSender) send() error {
copy(s.pkt[:], cpy) copy(s.pkt[:], cpy)
p := (*packet.Packet)(&s.pkt) p := (*packet.Packet)(&s.pkt)
pid := p.PID() s.curPid = p.PID()
if pid == mts.PatPid && len(s.buf) > 0 { return nil
}
// send checks the most recently loaded packet and if it is a PAT then the clip
// in s.buf is sent, otherwise the packet is added to s.buf.
func (s *mtsSender) send() error {
if s.curPid == mts.PatPid && len(s.buf) > 0 {
err := s.fixAndSend() err := s.fixAndSend()
if err != nil { if err != nil {
s.failed = true s.failed = true