Skip to content

Commit

Permalink
Merge pull request #5 from kierank/srt-new
Browse files Browse the repository at this point in the history
upipe-srt/handshake: Do not output an ACKACK on Light ACKS or Small ACKS
  • Loading branch information
funman authored Dec 11, 2023
2 parents 4dbd8f5 + 20be6bb commit 286021e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/upipe-srt/upipe_srt_handshake.c
Original file line number Diff line number Diff line change
Expand Up @@ -1213,6 +1213,11 @@ static struct uref *upipe_srt_handshake_handle_ack(struct upipe *upipe, const ui
{
struct upipe_srt_handshake *upipe_srt_handshake = upipe_srt_handshake_from_upipe(upipe);
uint32_t timestamp = (now - upipe_srt_handshake->establish_time) / 27;
uint32_t ack_number = srt_get_control_packet_type_specific(buf);

/* Don't output an ACKACK on Light ACKs or Small ACKs */
if (!ack_number)
return NULL;

struct uref *uref = uref_block_alloc(upipe_srt_handshake->uref_mgr,
upipe_srt_handshake->ubuf_mgr, SRT_HEADER_SIZE + 4 /* WTF */);
Expand All @@ -1230,7 +1235,7 @@ static struct uref *upipe_srt_handshake_handle_ack(struct upipe *upipe, const ui
srt_set_packet_dst_socket_id(out, upipe_srt_handshake->remote_socket_id);
srt_set_control_packet_type(out, SRT_CONTROL_TYPE_ACKACK);
srt_set_control_packet_subtype(out, 0);
srt_set_control_packet_type_specific(out, srt_get_control_packet_type_specific(buf));
srt_set_control_packet_type_specific(out, ack_number);
uint8_t *extra = (uint8_t*)srt_get_control_packet_cif(out);
memset(extra, 0, 4);

Expand Down

0 comments on commit 286021e

Please sign in to comment.