matroska: Use g_array_unref everywhere

Instead of using g_array_free which is not thread safe use g_array_unref instead

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1203>
This commit is contained in:
Rafał Dzięgiel 2021-11-12 11:28:23 +01:00 committed by GStreamer Marge Bot
parent 972615cf22
commit 478f94edc7
4 changed files with 7 additions and 7 deletions

View file

@ -175,7 +175,7 @@ void
gst_ebml_read_clear (GstEbmlRead * ebml) gst_ebml_read_clear (GstEbmlRead * ebml)
{ {
if (ebml->readers) if (ebml->readers)
g_array_free (ebml->readers, TRUE); g_array_unref (ebml->readers);
ebml->readers = NULL; ebml->readers = NULL;
if (ebml->buf) { if (ebml->buf) {
gst_buffer_unmap (ebml->buf, &ebml->map); gst_buffer_unmap (ebml->buf, &ebml->map);

View file

@ -328,7 +328,7 @@ gst_matroska_demux_reset (GstElement * element)
demux->tracks_parsed = FALSE; demux->tracks_parsed = FALSE;
if (demux->clusters) { if (demux->clusters) {
g_array_free (demux->clusters, TRUE); g_array_unref (demux->clusters);
demux->clusters = NULL; demux->clusters = NULL;
} }

View file

@ -349,14 +349,14 @@ gst_matroska_track_free (GstMatroskaTrackContext * track)
g_free (enc->comp_settings); g_free (enc->comp_settings);
} }
g_array_free (track->encodings, TRUE); g_array_unref (track->encodings);
} }
if (track->tags) if (track->tags)
gst_tag_list_unref (track->tags); gst_tag_list_unref (track->tags);
if (track->index_table) if (track->index_table)
g_array_free (track->index_table, TRUE); g_array_unref (track->index_table);
if (track->stream_headers) if (track->stream_headers)
gst_buffer_list_unref (track->stream_headers); gst_buffer_list_unref (track->stream_headers);

View file

@ -1809,7 +1809,7 @@ gst_matroska_read_common_parse_index (GstMatroskaReadCommon * common,
guint i; guint i;
if (common->index) if (common->index)
g_array_free (common->index, TRUE); g_array_unref (common->index);
common->index = common->index =
g_array_sized_new (FALSE, FALSE, sizeof (GstMatroskaIndex), 128); g_array_sized_new (FALSE, FALSE, sizeof (GstMatroskaIndex), 128);
@ -1897,7 +1897,7 @@ gst_matroska_read_common_parse_index (GstMatroskaReadCommon * common,
/* sanity check; empty index normalizes to no index */ /* sanity check; empty index normalizes to no index */
if (common->index->len == 0) { if (common->index->len == 0) {
g_array_free (common->index, TRUE); g_array_unref (common->index);
common->index = NULL; common->index = NULL;
} }
@ -3319,7 +3319,7 @@ gst_matroska_read_common_reset (GstElement * element,
/* reset indexes */ /* reset indexes */
if (ctx->index) { if (ctx->index) {
g_array_free (ctx->index, TRUE); g_array_unref (ctx->index);
ctx->index = NULL; ctx->index = NULL;
} }