mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
mxfvanc: Handle empty VANC packets
Some XDCAM recorders store empty packets for VANC, and don't even include the 2byte length. Handle them in the same way as VANC packets with 0 packets. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2122>
This commit is contained in:
parent
af71adf315
commit
80e83089b5
1 changed files with 8 additions and 1 deletions
|
@ -116,7 +116,9 @@ mxf_vanc_handle_essence_element (const MXFUL * key, GstBuffer * buffer,
|
|||
return GST_FLOW_ERROR;
|
||||
}
|
||||
|
||||
if (gst_buffer_get_size (buffer) < 2) {
|
||||
/* Either there is no data or there is at least room for the 16bit length,
|
||||
* therefore the only invalid packet length is 1 */
|
||||
if (gst_buffer_get_size (buffer) == 1) {
|
||||
GST_ERROR ("Invalid VANC essence element size");
|
||||
gst_buffer_unref (buffer);
|
||||
return GST_FLOW_ERROR;
|
||||
|
@ -125,6 +127,11 @@ mxf_vanc_handle_essence_element (const MXFUL * key, GstBuffer * buffer,
|
|||
gst_buffer_map (buffer, &map, GST_MAP_READ);
|
||||
gst_byte_reader_init (&reader, map.data, map.size);
|
||||
|
||||
/* Some XDCAM recorders store empty vanc packets (without even the
|
||||
* length). Treat them as gaps */
|
||||
if (map.size == 0)
|
||||
goto no_data;
|
||||
|
||||
num_packets = gst_byte_reader_get_uint16_be_unchecked (&reader);
|
||||
if (num_packets == 0) {
|
||||
/* SMPTE 436-1:2013 5.5 The Number of VI Lines or ANC Packets Property
|
||||
|
|
Loading…
Reference in a new issue