summaryrefslogtreecommitdiffstats
path: root/gst/mxf/mxfparse.c
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2008-11-24 10:41:13 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2008-11-24 10:41:13 +0000
commitfa9ccc1eca9c3c4472d6e7946e59d958382a764f (patch)
tree5fc9849d6e60d4fd6a7fe4817412b5c252ad31ac /gst/mxf/mxfparse.c
parent25d2d8f48a1c0f9dcbeabfff01946389e3c469a8 (diff)
downloadgst-plugins-bad-fa9ccc1eca9c3c4472d6e7946e59d958382a764f.tar.gz
gst-plugins-bad-fa9ccc1eca9c3c4472d6e7946e59d958382a764f.tar.bz2
gst-plugins-bad-fa9ccc1eca9c3c4472d6e7946e59d958382a764f.zip
gst/mxf/: Allow non-MXF KLV packets and just drop them instead of throwing an error and handle 9 byte product version...
Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_pull_klv_packet), (gst_mxf_demux_handle_klv_packet), (gst_mxf_demux_chain): * gst/mxf/mxfparse.c: (mxf_product_version_parse), (mxf_metadata_identification_parse), (mxf_metadata_content_storage_parse): Allow non-MXF KLV packets and just drop them instead of throwing an error and handle 9 byte product versions as written by Avid. This doesn't add support for the non-standard Avid MXF files but at least makes it possible to parse their header metadata. Fix a copy&paste error in debug output.
Diffstat (limited to 'gst/mxf/mxfparse.c')
-rw-r--r--gst/mxf/mxfparse.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/gst/mxf/mxfparse.c b/gst/mxf/mxfparse.c
index 9a854a34..e9efac92 100644
--- a/gst/mxf/mxfparse.c
+++ b/gst/mxf/mxfparse.c
@@ -376,14 +376,19 @@ mxf_product_version_parse (MXFProductVersion * product_version,
memset (product_version, 0, sizeof (MXFProductVersion));
- if (size < 10)
+ if (size < 9)
return FALSE;
product_version->major = GST_READ_UINT16_BE (data);
product_version->minor = GST_READ_UINT16_BE (data + 2);
product_version->patch = GST_READ_UINT16_BE (data + 4);
product_version->build = GST_READ_UINT16_BE (data + 6);
- product_version->release = GST_READ_UINT16_BE (data + 8);
+
+ /* Avid writes a 9 byte product version */
+ if (size == 9)
+ product_version->release = GST_READ_UINT8 (data + 8);
+ else
+ product_version->release = GST_READ_UINT16_BE (data + 8);
return TRUE;
}
@@ -921,8 +926,6 @@ mxf_metadata_identification_parse (const MXFUL * key,
break;
case 0x3c03:
GST_WRITE_UINT16_BE (data, 0x0000);
- if (tag_size != 10)
- goto error;
if (!mxf_product_version_parse (&identification->product_version,
tag_data, tag_size))
goto error;
@@ -939,16 +942,12 @@ mxf_metadata_identification_parse (const MXFUL * key,
break;
case 0x3c06:
GST_WRITE_UINT16_BE (data, 0x0000);
- if (tag_size != 8)
- goto error;
if (!mxf_timestamp_parse (&identification->modification_date, tag_data,
tag_size))
goto error;
break;
case 0x3c07:
GST_WRITE_UINT16_BE (data, 0x0000);
- if (tag_size != 10)
- goto error;
if (!mxf_product_version_parse (&identification->toolkit_version,
tag_data, tag_size))
goto error;
@@ -1126,7 +1125,7 @@ mxf_metadata_content_storage_parse (const MXFUL * key,
for (i = 0; i < content_storage->n_packages; i++)
GST_DEBUG (" package %u = %s", i,
mxf_ul_to_string (&content_storage->packages_uids[i], str));
- for (i = 0; i < content_storage->n_packages; i++)
+ for (i = 0; i < content_storage->n_essence_container_data; i++)
GST_DEBUG (" essence container data %u = %s", i,
mxf_ul_to_string (&content_storage->essence_container_data_uids[i],
str));