mpegtspacketizer: handle "packetizing" already packetized data
authorMathieu Duponchelle <mathieu@centricular.com>
Thu, 22 Apr 2021 23:19:21 +0000 (01:19 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Sat, 25 Sep 2021 01:29:38 +0000 (01:29 +0000)
.. 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>

subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtssection.c

index 04e85bc..6bc691c 100644 (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;