From 3dfcd7f58cb28ec6058e617e1dbaa95fcdf31123 Mon Sep 17 00:00:00 2001 From: Duncan Leo Date: Tue, 21 Apr 2020 00:44:26 +0800 Subject: [PATCH] fix: add doorbell accessory before IP transport --- cmd/hc-camera-ffmpeg/main.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/hc-camera-ffmpeg/main.go b/cmd/hc-camera-ffmpeg/main.go index 5f65798..3af561a 100644 --- a/cmd/hc-camera-ffmpeg/main.go +++ b/cmd/hc-camera-ffmpeg/main.go @@ -89,17 +89,6 @@ func main() { cameraAcc, snapshotFunc := camera.CreateCamera(cameraInfo, inputCfg, encProfile) - t, err := hc.NewIPTransport(hcConfig, cameraAcc.Accessory) - if err != nil { - log.Fatal(err) - } - - t.CameraSnapshotReq = snapshotFunc - - hc.OnTermination(func() { - <-t.Stop() - }) - if *doorbell { var doorbellService = service.NewDoorbell() cameraAcc.AddService(doorbellService.Service) @@ -122,5 +111,16 @@ func main() { } + t, err := hc.NewIPTransport(hcConfig, cameraAcc.Accessory) + if err != nil { + log.Fatal(err) + } + + t.CameraSnapshotReq = snapshotFunc + + hc.OnTermination(func() { + <-t.Stop() + }) + t.Start() }