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