Skip to content

Commit

Permalink
MT#55283 fix possible mem leak
Browse files Browse the repository at this point in the history
... and slightly improve log printing by including the PT number

Change-Id: Ie3aae38a32ac6cbab54b6471e2f029db6432c4ed
(cherry picked from commit f24f59e)
  • Loading branch information
rfuchs committed Nov 9, 2023
1 parent 23c5a90 commit 8c62230
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions daemon/codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -4672,18 +4672,20 @@ void codec_tracker_update(struct codec_store *cs) {
if (!is_codec_touched_rate(sct, clockrate))
continue;

ilogs(codec, LOG_DEBUG, "Adding supplemental codec " STR_FORMAT " for clock rate %u", STR_FMT(supp_codec), clockrate);

char *pt_s = g_strdup_printf(STR_FORMAT "/%u", STR_FMT(supp_codec), clockrate);
AUTO_CLEANUP_GBUF(pt_s);
pt_s = g_strdup_printf(STR_FORMAT "/%u", STR_FMT(supp_codec), clockrate);
str pt_str = STR_INIT(pt_s);

struct rtp_payload_type *pt = codec_add_payload_type(&pt_str, cs->media, NULL, NULL);
if (!pt)
continue;

ilogs(codec, LOG_DEBUG, "Adding supplemental codec " STR_FORMAT " for clock rate %u (%i)",
STR_FMT(supp_codec), clockrate, pt->payload_type);

pt->for_transcoding = 1;

codec_store_add_raw_order(cs, pt);
g_free(pt_s);
}

// finally check which clock rates are left over and remove those
Expand Down

0 comments on commit 8c62230

Please sign in to comment.