If the VANC track does contain packets, but we skip over all packets, just
treat it the same as if there hadn't been any packets at all and send a
GAP event instead of erroring out with "Failed to handle essence element".
We would error out because when we reach the end of the loop without having
found a closed caption packet the flow return variable is still FLOW_ERROR
which is what it has been initialised to.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1518>
*
* The same scheme can be used for ANC packets.
*/
*
* The same scheme can be used for ANC packets.
*/
-
- *outbuf = gst_buffer_new ();
- GST_BUFFER_FLAG_SET (*outbuf, GST_BUFFER_FLAG_GAP);
- ret = GST_FLOW_OK;
- goto out;
for (i = 0; i < num_packets; i++) {
G_GNUC_UNUSED guint16 line_num;
G_GNUC_UNUSED guint8 wrapping_type;
for (i = 0; i < num_packets; i++) {
G_GNUC_UNUSED guint16 line_num;
G_GNUC_UNUSED guint8 wrapping_type;
/* Not S334 EIA-708 */
if (did != 0x61 && sdid != 0x01) {
/* Not S334 EIA-708 */
if (did != 0x61 && sdid != 0x01) {
+ GST_TRACE ("Skipping VANC data with DID/SDID 0x%02X/0x%02X", did, sdid);
if (!gst_byte_reader_skip (&reader, array_count * array_item_size - 2))
goto out;
continue;
if (!gst_byte_reader_skip (&reader, array_count * array_item_size - 2))
goto out;
continue;
gst_buffer_unref (buffer);
return GST_FLOW_OK;
}
gst_buffer_unref (buffer);
return GST_FLOW_OK;
}
+
+no_data:
+
+ /* No packets or we skipped over all packets */
+ *outbuf = gst_buffer_new ();
+ GST_BUFFER_FLAG_SET (*outbuf, GST_BUFFER_FLAG_GAP);
+ ret = GST_FLOW_OK;
+
out:
gst_buffer_unmap (buffer, &map);
gst_buffer_unref (buffer);
out:
gst_buffer_unmap (buffer, &map);
gst_buffer_unref (buffer);