mirror of https://bitbucket.org/ausocean/av.git
revid: initialising ring buffer in different location
This commit is contained in:
parent
be6e168774
commit
b7d1bd17a7
|
@ -187,7 +187,6 @@ func (p *packer) Write(frame []byte) (int, error) {
|
|||
// an error if construction of the new instance was not successful.
|
||||
func New(c Config, ns *netsender.Sender) (*Revid, error) {
|
||||
r := Revid{ns: ns, err: make(chan error)}
|
||||
r.buffer = ring.NewBuffer(ringBufferSize, ringBufferElementSize, writeTimeout)
|
||||
r.packer.owner = &r
|
||||
err := r.reset(c)
|
||||
if err != nil {
|
||||
|
@ -230,6 +229,8 @@ func (r *Revid) reset(config Config) error {
|
|||
}
|
||||
r.config = config
|
||||
|
||||
r.buffer = ring.NewBuffer(ringBufferSize, ringBufferElementSize, writeTimeout)
|
||||
|
||||
for _, dest := range r.destination {
|
||||
if dest != nil {
|
||||
err = dest.close()
|
||||
|
|
Loading…
Reference in New Issue