From dad67b7af0b7002c3321ebb4ef6e473a0d496de3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 10 Sep 2012 16:52:46 +0100 Subject: [PATCH] sample: free info structure with sample if there is one and fix copy with NULL info structure --- gst/gstsample.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gst/gstsample.c b/gst/gstsample.c index 618d328..93cb0b0 100644 --- a/gst/gstsample.c +++ b/gst/gstsample.c @@ -59,7 +59,7 @@ _gst_sample_copy (GstSample * sample) GstSample *copy; copy = gst_sample_new (sample->buffer, sample->caps, &sample->segment, - gst_structure_copy (sample->info)); + (sample->info) ? gst_structure_copy (sample->info) : NULL); return copy; } @@ -73,7 +73,10 @@ _gst_sample_free (GstSample * sample) gst_buffer_unref (sample->buffer); if (sample->caps) gst_caps_unref (sample->caps); - + if (sample->info) { + gst_structure_set_parent_refcount (sample->info, NULL); + gst_structure_free (sample->info); + } g_slice_free1 (sizeof (GstSample), sample); } -- 2.7.4