diff --git a/daemon/rtcp.c b/daemon/rtcp.c index cb7b277b7..11a079f15 100644 --- a/daemon/rtcp.c +++ b/daemon/rtcp.c @@ -1597,7 +1597,7 @@ void rtcp_send_report(struct call_media *media, struct ssrc_ctx *ssrc_out) { // handle crypto - str rtcp_packet = STR_INIT_LEN(sr->str, sr->len); + str rtcp_packet = STR_INIT_GS(sr); const struct streamhandler *crypt_handler = determine_handler(&transport_protocols[PROTO_RTP_AVP], media, true); diff --git a/daemon/t38.c b/daemon/t38.c index 17b72bc47..a409aa518 100644 --- a/daemon/t38.c +++ b/daemon/t38.c @@ -713,7 +713,7 @@ int t38_gateway_input_udptl(struct t38_gateway *tg, const str *buf) { "packet with seq %i from FEC", seq_fec); - str rec_str = STR_INIT_LEN(rec_s->str, rec_s->len); + str rec_str = STR_INIT_GS(rec_s); __fec_save(tg, &rec_str, seq_fec); up = __make_udptl_packet(&rec_str, seq_fec); packet_sequencer_insert(&tg->sequencer, &up->p); diff --git a/lib/str.h b/lib/str.h index 6dbed2032..6a0c68b2e 100644 --- a/lib/str.h +++ b/lib/str.h @@ -38,6 +38,7 @@ TYPED_GQUEUE(str, str) #define STR_EMPTY ((str) { "", 0 }) #define STR_CONST_INIT(s) ((str) { s, sizeof(s)-1 }) #define STR_INIT(s) ((str) { (char *) (s), (s) ? strlen(s) : 0 }) +#define STR_INIT_GS(s) ((str) { (s)->str, (s)->len }) #define STR_INIT_LEN(s, len) ((str) { (char *) (s), len }) #define STR_INIT_DUP(s) ((str) { g_strdup(s), strlen(s) }) #define STR_CONST_INIT_BUF(buf) ((str) { (char *) &buf, sizeof(buf) })