MT#55283 switch basic GQueue to g_auto

Change-Id: I3b17e0a0f6e451e3a0e62c209a887db6ac1f7f55
pull/1759/head
Richard Fuchs 2 years ago
parent f7edf11d6a
commit 43d1427b4d

@ -3069,7 +3069,7 @@ static void __unsubscribe_medias_from_all(struct call_monologue *ml) {
*/
static struct call_monologue * ml_medias_subscribed_to_single_ml(struct call_monologue *ml) {
/* detect monologues multiplicity */
AUTO_CLEANUP(GQueue mls, g_queue_clear) = G_QUEUE_INIT;
g_auto(GQueue) mls = G_QUEUE_INIT;
struct call_monologue * return_ml = NULL;
for (unsigned int i = 0; i < ml->medias->len; i++)
{
@ -3384,7 +3384,7 @@ int monologue_subscribe_request(const GQueue *srms, struct call_monologue *dst_m
__unsubscribe_medias_from_all(dst_ml);
__call_monologue_init_from_flags(dst_ml, flags);
AUTO_CLEANUP(GQueue mls, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */
g_auto(GQueue) mls = G_QUEUE_INIT; /* to avoid duplications */
for (GList *sl = srms->head; sl; sl = sl->next)
{
struct media_subscription *ms = sl->data;
@ -3408,7 +3408,7 @@ int monologue_subscribe_answer(struct call_monologue *dst_ml, struct sdp_ng_flag
bool print_extra_sess_attrs)
{
struct media_subscription *rev_ms = NULL;
AUTO_CLEANUP(GQueue attr_mls, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */
g_auto(GQueue) attr_mls = G_QUEUE_INIT; /* to avoid duplications */
for (GList * l = streams->head; l; l = l->next)
{
@ -3476,7 +3476,7 @@ int monologue_subscribe_answer(struct call_monologue *dst_ml, struct sdp_ng_flag
}
/* TODO: move inside the cycle above, to reduce iterations amount */
AUTO_CLEANUP(GQueue mls, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */
g_auto(GQueue) mls = G_QUEUE_INIT; /* to avoid duplications */
for (int i = 0; i < dst_ml->medias->len; i++)
{
struct call_media * dst_media = dst_ml->medias->pdata[i];
@ -4771,7 +4771,7 @@ static void monologue_stop(struct call_monologue *ml, bool stop_media_subsribers
}
/* monologue's subscribers */
if (stop_media_subsribers) {
AUTO_CLEANUP(GQueue mls, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */
g_auto(GQueue) mls = G_QUEUE_INIT; /* to avoid duplications */
for (unsigned int i = 0; i < ml->medias->len; i++)
{
struct call_media *media = ml->medias->pdata[i];

@ -2321,8 +2321,8 @@ static void ng_stats_monologue(bencode_item_t *dict, const struct call_monologue
{
bencode_item_t *sub, *medias = NULL;
struct call_media *m;
AUTO_CLEANUP(GQueue mls_subscriptions, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */
AUTO_CLEANUP(GQueue mls_subscribers, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */
g_auto(GQueue) mls_subscriptions = G_QUEUE_INIT; /* to avoid duplications */
g_auto(GQueue) mls_subscribers = G_QUEUE_INIT; /* to avoid duplications */
if (!ml)
return;
@ -2504,7 +2504,7 @@ stats:
ml = call_get_monologue(call, match_tag);
if (ml) {
ng_stats_monologue(tags, ml, totals, ssrc);
AUTO_CLEANUP(GQueue mls, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */
g_auto(GQueue) mls = G_QUEUE_INIT; /* to avoid duplications */
for (int i = 0; i < ml->medias->len; i++)
{
struct call_media * media = ml->medias->pdata[i];
@ -3041,7 +3041,7 @@ static const char *call_block_silence_media(bencode_item_t *input, bool on_off,
return errstr;
if (monologue) {
AUTO_CLEANUP(GQueue sinks, g_queue_clear) = G_QUEUE_INIT;
g_auto(GQueue) sinks = G_QUEUE_INIT;
if (flags.to_tag.len) {
struct call_monologue *sink = g_hash_table_lookup(call->tags, &flags.to_tag);
if (!sink) {
@ -3207,7 +3207,7 @@ static const char *play_media_select_party(struct call **call, GQueue *monologue
const char *call_play_media_ng(bencode_item_t *input, bencode_item_t *output) {
#ifdef WITH_TRANSCODING
AUTO_CLEANUP_NULL(struct call *call, call_unlock_release);
AUTO_CLEANUP(GQueue monologues, g_queue_clear);
g_auto(GQueue) monologues;
const char *err = NULL;
AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags);
@ -3262,7 +3262,7 @@ const char *call_play_media_ng(bencode_item_t *input, bencode_item_t *output) {
const char *call_stop_media_ng(bencode_item_t *input, bencode_item_t *output) {
#ifdef WITH_TRANSCODING
AUTO_CLEANUP_NULL(struct call *call, call_unlock_release);
AUTO_CLEANUP(GQueue monologues, g_queue_clear);
g_auto(GQueue) monologues;
const char *err = NULL;
long long last_frame_pos = 0;
AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags);
@ -3295,7 +3295,7 @@ const char *call_stop_media_ng(bencode_item_t *input, bencode_item_t *output) {
const char *call_play_dtmf_ng(bencode_item_t *input, bencode_item_t *output) {
#ifdef WITH_TRANSCODING
AUTO_CLEANUP_NULL(struct call *call, call_unlock_release);
AUTO_CLEANUP(GQueue monologues, g_queue_clear);
g_auto(GQueue) monologues;
const char *err = NULL;
AUTO_CLEANUP(struct sdp_ng_flags flags, call_ng_free_flags);

@ -82,7 +82,7 @@ void cdr_update_entry(struct call* c) {
cdrlinecnt, ml->tag.s,
cdrlinecnt, get_tag_type_text(ml->tagtype));
AUTO_CLEANUP(GQueue mls, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */
g_auto(GQueue) mls = G_QUEUE_INIT; /* to avoid duplications */
for (int i = 0; i < ml->medias->len; i++)
{
struct call_media * media = ml->medias->pdata[i];

@ -5102,7 +5102,7 @@ void codec_store_accept(struct codec_store *cs, GQueue *accept, struct codec_sto
// mark codecs as `for transcoding`
for (GList *l = accept->head; l; l = l->next) {
str *codec = l->data;
AUTO_CLEANUP(GQueue pts_matched, g_queue_clear) = G_QUEUE_INIT;
g_auto(GQueue) pts_matched = G_QUEUE_INIT;
GQueue *pts = &pts_matched;
if (!str_cmp(codec, "all") || !str_cmp(codec, "full"))

@ -3066,7 +3066,7 @@ out:
unconfirm_sinks(&phc->mp.stream->rtcp_sinks, "peer address unconfirmed");
}
if (phc->unkernelize_subscriptions) {
AUTO_CLEANUP(GQueue mls, g_queue_clear) = G_QUEUE_INIT; /* to avoid duplications */
g_auto(GQueue) mls = G_QUEUE_INIT; /* to avoid duplications */
for (GList * sub = phc->mp.media->media_subscriptions.head; sub; sub = sub->next)
{
struct media_subscription * ms = sub->data;

@ -953,7 +953,7 @@ void statistics_init(void) {
const char *statistics_ng(bencode_item_t *input, bencode_item_t *output) {
AUTO_CLEANUP_INIT(GQueue *metrics, statistics_free_metrics, statistics_gather_metrics(NULL));
AUTO_CLEANUP_INIT(GQueue bstack, g_queue_clear, G_QUEUE_INIT);
g_auto(GQueue) bstack = G_QUEUE_INIT;
bencode_item_t *dict = output;
const char *sub_label = "statistics"; // top level

@ -2818,7 +2818,7 @@ static void amr_bitrate_tracker(decoder_t *dec, unsigned int ft) {
}
static int amr_decoder_input(decoder_t *dec, const str *data, GQueue *out) {
const char *err = NULL;
AUTO_CLEANUP(GQueue toc, g_queue_clear) = G_QUEUE_INIT;
g_auto(GQueue) toc = G_QUEUE_INIT;
if (!data || !data->s)
goto err;

Loading…
Cancel
Save