if (program->pmt_info)
gst_structure_free (program->pmt_info);
- program->pmt_info = gst_structure_copy (pmt_info);
+ program->pmt_info = pmt_info;
program->pmt_pid = pmt_pid;
program->pcr_pid = pcr_pid;
*/
old_pat = base->pat;
- base->pat = gst_structure_copy (pat_info);
+ base->pat = pat_info;
gst_element_post_message (GST_ELEMENT_CAST (base),
gst_message_new_element (GST_OBJECT (base),
} else
program = old_program;
- /* First activate program */
+ /* activate program */
+ /* Ownership of pmt_info is given to the program */
mpegts_base_activate_program (base, program, pmt_pid, pmt_info,
initial_program);
- /* if (program->pmt_info) */
- /* gst_structure_free (program->pmt_info); */
- /* program->pmt_info = NULL; */
-
gst_element_post_message (GST_ELEMENT_CAST (base),
gst_message_new_element (GST_OBJECT (base),
gst_structure_copy (pmt_info)));
no_program:
{
GST_ERROR ("Attempted to apply a PMT on a program that wasn't created");
+ gst_structure_free (pmt_info);
return;
}
same_program:
{
GST_DEBUG ("Not applying identical program");
+ gst_structure_free (pmt_info);
return;
}
}
GST_DEBUG_OBJECT (base, "CAT %" GST_PTR_FORMAT, cat_info);
gst_element_post_message (GST_ELEMENT_CAST (base),
- gst_message_new_element (GST_OBJECT (base),
- gst_structure_copy (cat_info)));
+ gst_message_new_element (GST_OBJECT (base), cat_info));
}
static void
GST_DEBUG_OBJECT (base, "NIT %" GST_PTR_FORMAT, nit_info);
gst_element_post_message (GST_ELEMENT_CAST (base),
- gst_message_new_element (GST_OBJECT (base),
- gst_structure_copy (nit_info)));
+ gst_message_new_element (GST_OBJECT (base), nit_info));
}
static void
mpegts_base_get_tags_from_sdt (base, sdt_info);
gst_element_post_message (GST_ELEMENT_CAST (base),
- gst_message_new_element (GST_OBJECT (base),
- gst_structure_copy (sdt_info)));
+ gst_message_new_element (GST_OBJECT (base), sdt_info));
}
static void
mpegts_base_get_tags_from_eit (base, eit_info);
gst_element_post_message (GST_ELEMENT_CAST (base),
- gst_message_new_element (GST_OBJECT (base),
- gst_structure_copy (eit_info)));
+ gst_message_new_element (GST_OBJECT (base), eit_info));
}
static void
gst_structure_copy (tdt_info)));
GST_MPEGTS_BASE_GET_CLASS (base)->push_event (base,
- gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM,
- gst_structure_copy (tdt_info)));
+ gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM, tdt_info));
}
break;
}
- if (structure)
- gst_structure_free (structure);
-
return res;
}