Browse Source

MT#55283 use g_auto for GHashTable

Change-Id: I698f661711104a0fd6a983c58c0256532e86f87e
pull/1769/head
Richard Fuchs 2 years ago
parent
commit
cfa560c6b4
3 changed files with 4 additions and 9 deletions
  1. +3
    -4
      daemon/codec.c
  2. +1
    -2
      daemon/websocket.c
  3. +0
    -3
      lib/auxlib.h

+ 3
- 4
daemon/codec.c View File

@ -1083,19 +1083,18 @@ void __codec_handlers_update(struct call_media *receiver, struct call_media *sin
} }
// first gather info about what we can send // first gather info about what we can send
AUTO_CLEANUP_NULL(GHashTable *supplemental_sinks, __g_hash_table_destroy);
g_autoptr(GHashTable) supplemental_sinks = NULL;
struct rtp_payload_type *pref_dest_codec = NULL; struct rtp_payload_type *pref_dest_codec = NULL;
__check_codec_list(&supplemental_sinks, &pref_dest_codec, sink, &sink->codecs.codec_prefs); __check_codec_list(&supplemental_sinks, &pref_dest_codec, sink, &sink->codecs.codec_prefs);
// then do the same with what we can receive // then do the same with what we can receive
AUTO_CLEANUP_NULL(GHashTable *supplemental_recvs, __g_hash_table_destroy);
g_autoptr(GHashTable) supplemental_recvs = NULL;
__check_codec_list(&supplemental_recvs, NULL, receiver, &receiver->codecs.codec_prefs); __check_codec_list(&supplemental_recvs, NULL, receiver, &receiver->codecs.codec_prefs);
// if multiple input codecs transcode to the same output codec, we want to make sure // if multiple input codecs transcode to the same output codec, we want to make sure
// that all the decoders output their media to the same encoder. we use the destination // that all the decoders output their media to the same encoder. we use the destination
// payload type to keep track of this. // payload type to keep track of this.
AUTO_CLEANUP(GHashTable *output_transcoders, __g_hash_table_destroy)
= g_hash_table_new(g_direct_hash, g_direct_equal);
g_autoptr(GHashTable) output_transcoders = g_hash_table_new(g_direct_hash, g_direct_equal);
enum block_dtmf_mode dtmf_block_mode = dtmf_get_block_mode(NULL, monologue); enum block_dtmf_mode dtmf_block_mode = dtmf_get_block_mode(NULL, monologue);
bool do_pcm_dtmf_blocking = is_pcm_dtmf_block_mode(dtmf_block_mode); bool do_pcm_dtmf_blocking = is_pcm_dtmf_block_mode(dtmf_block_mode);


+ 1
- 2
daemon/websocket.c View File

@ -382,8 +382,7 @@ static const char *websocket_http_metrics(struct websocket_message *wm) {
AUTO_CLEANUP_INIT(GQueue *metrics, statistics_free_metrics, statistics_gather_metrics(NULL)); AUTO_CLEANUP_INIT(GQueue *metrics, statistics_free_metrics, statistics_gather_metrics(NULL));
g_autoptr(GString) outp = g_string_new(""); g_autoptr(GString) outp = g_string_new("");
AUTO_CLEANUP_INIT(GHashTable *metric_types, __g_hash_table_destroy,
g_hash_table_new(g_str_hash, g_str_equal));
g_autoptr(GHashTable) metric_types = g_hash_table_new(g_str_hash, g_str_equal);
for (GList *l = metrics->head; l; l = l->next) { for (GList *l = metrics->head; l; l = l->next) {
struct stats_metric *m = l->data; struct stats_metric *m = l->data;


+ 0
- 3
lib/auxlib.h View File

@ -341,9 +341,6 @@ INLINE void g_tree_clear(GTree *t) {
g_tree_remove(t, k); g_tree_remove(t, k);
} }
} }
INLINE void __g_hash_table_destroy(GHashTable **s) {
g_hash_table_destroy(*s);
}
int g_tree_find_first_cmp(void *, void *, void *); int g_tree_find_first_cmp(void *, void *, void *);


Loading…
Cancel
Save