h264parse: re-use reset() in finalize()

This commit is contained in:
Mark Nauwelaerts 2010-12-07 14:55:15 +01:00 committed by Edward Hervey
parent 6f966febce
commit 26d69e63d4

View file

@ -1031,30 +1031,14 @@ static void
gst_h264_parse_finalize (GObject * object)
{
GstH264Parse *h264parse;
gint i;
h264parse = GST_H264PARSE (object);
gst_h264_parse_reset (h264parse);
g_object_unref (h264parse->adapter);
g_object_unref (h264parse->picture_adapter);
for (i = 0; i < MAX_SPS_COUNT; i++) {
if (h264parse->sps_buffers[i] != NULL)
g_slice_free (GstH264Sps, h264parse->sps_buffers[i]);
}
for (i = 0; i < MAX_PPS_COUNT; i++) {
if (h264parse->pps_buffers[i] != NULL)
g_slice_free (GstH264Pps, h264parse->pps_buffers[i]);
}
if (h264parse->pending_segment)
gst_event_replace (&h264parse->pending_segment, NULL);
g_list_foreach (h264parse->pending_events, (GFunc) gst_event_unref, NULL);
g_list_free (h264parse->pending_events);
h264parse->pending_events = NULL;
G_OBJECT_CLASS (parent_class)->finalize (object);
}