浏览代码

Merge pull request #49 from mcuadros/main

Reinitialize internal Go channel during Device.Start
Vladimir Vivien 2 年之前
父节点
当前提交
97073bcda2
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      device/device.go

+ 2 - 0
device/device.go

@@ -376,6 +376,8 @@ func (d *Device) Stop() error {
 // and report any errors. The loop runs in a separate goroutine and uses the sys.Select to trigger
 // capture events.
 func (d *Device) startStreamLoop(ctx context.Context) error {
+	d.output = make(chan []byte, d.config.bufSize)
+
 	// Initial enqueue of buffers for capture
 	for i := 0; i < int(d.config.bufSize); i++ {
 		_, err := v4l2.QueueBuffer(d.fd, d.config.ioType, d.bufType, uint32(i))