Skip to content

Commit

Permalink
homekit: fixup hap recordign cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Mar 8, 2023
1 parent 5d50785 commit a1d7a0d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugins/homekit/src/types/camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,17 @@ addSupportedType({
configuration = newConfiguration;
},
handleRecordingStreamRequest(streamId: number): AsyncGenerator<RecordingPacket> {
const ret = handleFragmentsRequests(streamId, device, configuration, console, homekitPlugin);
const d = new Deferred<any>();
d.promise.finally(() => openRecordingStreams.delete(streamId));
d.promise.then(reason => {
ret.throw(new Error(reason.toString()));
openRecordingStreams.delete(streamId);
});
openRecordingStreams.set(streamId, d);
return handleFragmentsRequests(streamId, device, configuration, console, homekitPlugin)
return ret;
},
closeRecordingStream(streamId, reason) {
openRecordingStreams.get(streamId)?.resolve(undefined);
openRecordingStreams.get(streamId)?.resolve(reason);
},
updateRecordingActive(active) {
},
Expand Down

0 comments on commit a1d7a0d

Please sign in to comment.