mpegtspacketizer: handle "packetizing" already packetized data

.. when the section didn't have a packetizer. This can happen
as a result of building a new section from a copy of the original
data of another section.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/913>
This commit is contained in:
Mathieu Duponchelle 2021-04-23 01:19:21 +02:00 committed by GStreamer Marge Bot
parent 4af003bc02
commit e4f40ba526

View file

@ -1296,7 +1296,6 @@ gst_mpegts_section_packetize (GstMpegtsSection * section, gsize * output_size)
guint8 *crc;
g_return_val_if_fail (section != NULL, NULL);
g_return_val_if_fail (output_size != NULL, NULL);
g_return_val_if_fail (section->packetizer != NULL, NULL);
/* Section data has already been packetized */
if (section->data) {
@ -1304,6 +1303,8 @@ gst_mpegts_section_packetize (GstMpegtsSection * section, gsize * output_size)
return section->data;
}
g_return_val_if_fail (section->packetizer != NULL, NULL);
if (!section->packetizer (section))
return NULL;