Skip to content

Commit

Permalink
rtcp: send BYE manually
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredh committed Jul 6, 2024
1 parent d3e521b commit f3914e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions include/re_rtp.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ int rtcp_send_fir_rfc5104(struct rtp_sock *rs, uint32_t ssrc,
int rtcp_debug(struct re_printf *pf, const struct rtp_sock *rs);
void *rtcp_sock(const struct rtp_sock *rs);
int rtcp_stats(struct rtp_sock *rs, uint32_t ssrc, struct rtcp_stats *stats);
int rtcp_send_bye_packet(struct rtp_sock *rs);

/* RTCP utils */
int rtcp_encode(struct mbuf *mb, enum rtcp_type type, uint32_t count, ...);
Expand Down
12 changes: 6 additions & 6 deletions src/rtp/sess.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,12 @@ struct rtcp_sess {

/* Prototypes */
static void schedule(struct rtcp_sess *sess);
static int send_bye_packet(struct rtcp_sess *sess);


static void sess_destructor(void *data)
{
struct rtcp_sess *sess = data;

if (sess->cname)
(void)send_bye_packet(sess);

tmr_cancel(&sess->tmr);

mem_deref(sess->cname);
Expand Down Expand Up @@ -509,9 +505,13 @@ static int send_rtcp_report(struct rtcp_sess *sess)
}


static int send_bye_packet(struct rtcp_sess *sess)
int rtcp_send_bye_packet(struct rtp_sock *rs)
{
const uint32_t ssrc = rtp_sess_ssrc(sess->rs);
if (!rs)
return EINVAL;

struct rtcp_sess *sess = rtp_rtcp_sess(rs);
const uint32_t ssrc = rtp_sess_ssrc(rs);
struct mbuf *mb;
int err;

Expand Down

0 comments on commit f3914e6

Please sign in to comment.