From 48e971398c389f5317d1238f0f44a6266357d3e4 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 6 Mar 2025 13:07:05 -0400 Subject: [PATCH] MT#55283 convert bit field to bool Change-Id: If2acf3bacadaf83ebc3a02c7c1d71aaa6a90258b --- daemon/call.c | 4 ++-- daemon/codec.c | 8 ++++---- daemon/redis.c | 2 +- include/media_socket.h | 9 +++++---- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index ecc5161af..4dd178dab 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -3112,7 +3112,7 @@ int monologue_offer_answer(struct call_monologue *monologues[2], sdp_streams_q * struct media_subscription * ms = call_get_media_subscription(receiver_media->media_subscribers_ht, sender_media); if (ms) - ms->attrs.transcoding = 0; + ms->attrs.transcoding = false; __media_init_from_flags(sender_media, receiver_media, sp, flags); @@ -3690,7 +3690,7 @@ int monologue_subscribe_answer(struct call_monologue *dst_ml, sdp_ng_flags *flag rev_ms = call_get_media_subscription(src_media->media_subscribers_ht, dst_media); if (rev_ms) - rev_ms->attrs.transcoding = 0; + rev_ms->attrs.transcoding = false; __media_init_from_flags(dst_media, NULL, sp, flags); diff --git a/daemon/codec.c b/daemon/codec.c index 696fa6850..ef3de48bb 100644 --- a/daemon/codec.c +++ b/daemon/codec.c @@ -1079,7 +1079,7 @@ void __codec_handlers_update(struct call_media *receiver, struct call_media *sin STR_FMT_M(&other_monologue->tag), sink->index); if (a.reset_transcoding && ms) - ms->attrs.transcoding = 0; + ms->attrs.transcoding = false; MEDIA_CLEAR(receiver, GENERATOR); MEDIA_CLEAR(sink, GENERATOR); @@ -1093,7 +1093,7 @@ void __codec_handlers_update(struct call_media *receiver, struct call_media *sin if (proto_is(receiver->protocol, PROTO_UDPTL)) { if (codec_handler_udptl_update(receiver, sink, a.flags)) { if (a.reset_transcoding && ms) - ms->attrs.transcoding = 1; + ms->attrs.transcoding = true; return; } } @@ -1109,7 +1109,7 @@ void __codec_handlers_update(struct call_media *receiver, struct call_media *sin if (proto_is_not_rtp(sink->protocol)) { if (codec_handler_non_rtp_update(receiver, sink, a.flags, a.sp)) { if (a.reset_transcoding && ms) - ms->attrs.transcoding = 1; + ms->attrs.transcoding = true; return; } } @@ -1483,7 +1483,7 @@ next: if (is_transcoding) { if (a.reset_transcoding && ms) - ms->attrs.transcoding = 1; + ms->attrs.transcoding = true; for (__auto_type l = receiver->codecs.codec_prefs.head; l; ) { rtp_payload_type *pt = l->data; diff --git a/daemon/redis.c b/daemon/redis.c index bb527d201..5c10dfba0 100644 --- a/daemon/redis.c +++ b/daemon/redis.c @@ -1865,7 +1865,7 @@ static int json_link_streams(call_t *c, struct redis_list *streams, struct media_subscription *ms = __find_media_subscriber(media, sink); if (ms && ms->attrs.egress) continue; - struct sink_attrs attrs = { .rtcp_only = (ms && ms->attrs.rtcp_only) ? 1 : 0 }; + struct sink_attrs attrs = { .rtcp_only = !!(ms && ms->attrs.rtcp_only) }; __add_sink_handler(&ps->rtp_sinks, sink, &attrs); } g_queue_clear(&q); diff --git a/include/media_socket.h b/include/media_socket.h index c1bf5db19..cb63895fb 100644 --- a/include/media_socket.h +++ b/include/media_socket.h @@ -238,13 +238,14 @@ struct stream_fd { }; struct sink_attrs { + // cannot be bit fields because G_STRUCT_OFFSET is used on them bool block_media; bool silence_media; - unsigned int offer_answer:1; // bidirectional, exclusive - unsigned int rtcp_only:1; - unsigned int transcoding:1; - unsigned int egress:1; + bool offer_answer:1; // bidirectional, exclusive + bool rtcp_only:1; + bool transcoding:1; + bool egress:1; }; /**