mirror of https://bitbucket.org/ausocean/av.git
stream/mts: fixed build errors
This commit is contained in:
parent
d3a8bb20de
commit
694ec5d009
|
@ -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.
|
// 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.
|
// TODO: this will probably break if we already have adaptation field.
|
||||||
func addAdaptationField(p *[PacketSize]byte, options ...Option) error {
|
func addAdaptationField(p *[PacketSize]byte, options ...Option) error {
|
||||||
b, err := packet.ContainsAdaptationField((*packet.Packet)(p))
|
if packet.ContainsAdaptationField((*packet.Packet)(p)) {
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if b {
|
|
||||||
return errors.New("Adaptation field is already present in packet")
|
return errors.New("Adaptation field is already present in packet")
|
||||||
}
|
}
|
||||||
// Create space for adaptation field.
|
// 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
|
// resetAdaptation sets fields in ps adaptation field to 0 if the adaptation field
|
||||||
// exists, otherwise an error is returned.
|
// exists, otherwise an error is returned.
|
||||||
func resetAdaptation(p *[PacketSize]byte) error {
|
func resetAdaptation(p *[PacketSize]byte) error {
|
||||||
b, err := packet.ContainsAdaptationField((*packet.Packet)(p))
|
if !packet.ContainsAdaptationField((*packet.Packet)(p)) {
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if !b {
|
|
||||||
return errors.New("No adaptation field in this packet")
|
return errors.New("No adaptation field in this packet")
|
||||||
}
|
}
|
||||||
p[AdaptationIdx] = DefaultAdaptationBodySize
|
p[AdaptationIdx] = DefaultAdaptationBodySize
|
||||||
|
|
Loading…
Reference in New Issue