Skip to content

Commit

Permalink
fix: add doorbell accessory before IP transport
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanleo committed Apr 20, 2020
1 parent fce5c20 commit 3dfcd7f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions cmd/hc-camera-ffmpeg/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
}

0 comments on commit 3dfcd7f

Please sign in to comment.