matroska-demux: Fix caps memleak

https://bugzilla.gnome.org/show_bug.cgi?id=797326
This commit is contained in:
Johan Bjäreholt 2018-10-17 12:58:08 +02:00 committed by Sebastian Dröge
parent 560a6155bd
commit e736f29376
3 changed files with 2 additions and 1 deletions

View file

@ -3278,6 +3278,7 @@ gst_matroska_demux_update_tracks (GstMatroskaDemux * demux, GstEbmlRead * ebml)
if (!gst_caps_is_equal (old_track->caps, new_track->caps)) {
gst_pad_set_caps (new_track->pad, new_track->caps);
}
gst_caps_replace (&old_track->caps, NULL);
if (!gst_tag_list_is_equal (old_track->tags, new_track->tags)) {
GST_DEBUG_OBJECT (old_track->pad, "Sending tags %p: %"

View file

@ -335,6 +335,7 @@ gst_matroska_track_free (GstMatroskaTrackContext * track)
g_free (track->language);
g_free (track->codec_priv);
g_free (track->codec_state);
gst_caps_replace (&track->caps, NULL);
if (track->encodings != NULL) {
int i;

View file

@ -3289,7 +3289,6 @@ gst_matroska_read_common_reset (GstElement * element,
if (context->pad != NULL)
gst_element_remove_pad (element, context->pad);
gst_caps_replace (&context->caps, NULL);
gst_matroska_track_free (context);
}
g_ptr_array_free (ctx->src, TRUE);