From 694ec5d009ce3a579be3c10721bd11582776d382 Mon Sep 17 00:00:00 2001 From: saxon Date: Fri, 15 Feb 2019 13:43:01 +1030 Subject: [PATCH] stream/mts: fixed build errors --- stream/mts/mpegts.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/stream/mts/mpegts.go b/stream/mts/mpegts.go index 0cfa0ca9..23fcee13 100644 --- a/stream/mts/mpegts.go +++ b/stream/mts/mpegts.go @@ -255,11 +255,7 @@ type Option func(p *[PacketSize]byte) // addAdaptationField adds an adaptation field to p, and applys the passed options to this field. // TODO: this will probably break if we already have adaptation field. func addAdaptationField(p *[PacketSize]byte, options ...Option) error { - b, err := packet.ContainsAdaptationField((*packet.Packet)(p)) - if err != nil { - return err - } - if b { + if packet.ContainsAdaptationField((*packet.Packet)(p)) { return errors.New("Adaptation field is already present in packet") } // Create space for adaptation field. @@ -282,11 +278,7 @@ func addAdaptationField(p *[PacketSize]byte, options ...Option) error { // resetAdaptation sets fields in ps adaptation field to 0 if the adaptation field // exists, otherwise an error is returned. func resetAdaptation(p *[PacketSize]byte) error { - b, err := packet.ContainsAdaptationField((*packet.Packet)(p)) - if err != nil { - return err - } - if !b { + if !packet.ContainsAdaptationField((*packet.Packet)(p)) { return errors.New("No adaptation field in this packet") } p[AdaptationIdx] = DefaultAdaptationBodySize