mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
sample: free info structure with sample if there is one and fix copy with NULL info structure
This commit is contained in:
parent
edb8bc8865
commit
dad67b7af0
1 changed files with 5 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue