Skip to content

Commit

Permalink
srts: delete key only after the required period has elapsed
Browse files Browse the repository at this point in the history
  • Loading branch information
funman committed Jun 14, 2024
1 parent d069633 commit dde433d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/upipe-srt/upipe_srt_sender.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,12 +672,13 @@ static inline void upipe_srt_sender_input(struct upipe *upipe, struct uref *uref

if (upipe_srt_sender->sek_len[0] || upipe_srt_sender->sek_len[1]) {
upipe_dbg_va(upipe, "Switching to %s key", even_key ? "even" : "odd");
memset(upipe_srt_sender->sek[even_key], 0, sizeof(upipe_srt_sender->sek[0]));
} else {
upipe_dbg(upipe, "Encryption disabled");
}

upipe_srt_sender->even_key = even_key;
} else if (upipe_srt_sender->packets_since_key == 2 * SRT_KM_PRE_ANNOUNCEMENT_PERIOD) {
memset(upipe_srt_sender->sek[upipe_srt_sender->even_key], 0, sizeof(upipe_srt_sender->sek[0]));
}

int key = !upipe_srt_sender->even_key;
Expand Down

0 comments on commit dde433d

Please sign in to comment.