Skip to content

Commit

Permalink
Catch case where recording starts right at end of request (#12956)
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 committed Aug 30, 2024
1 parent 07ffd76 commit 338b59a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frigate/api/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,11 @@ def vod_ts(camera_name, start_ts, end_ts):
if recording.end_time > end_ts:
duration -= int((recording.end_time - end_ts) * 1000)

if duration == 0:
# this means the segment starts right at the end of the requested time range
# and it does not need to be included
continue

if 0 < duration < max_duration_ms:
clip["keyFrameDurations"] = [duration]
clips.append(clip)
Expand Down

0 comments on commit 338b59a

Please sign in to comment.