Allow index table segments without primer pack

When parsing an index table segment without a valid
primer pack in this partition only parse the static
local tags and ignore all dynamic ones.

This allows us to use index table segments in some
broken files.
This commit is contained in:
Sebastian Dröge 2009-01-26 16:23:38 +01:00
parent 4162c36f17
commit afbec8ab9b
2 changed files with 13 additions and 11 deletions

View file

@ -586,11 +586,11 @@ gst_mxf_demux_choose_package (GstMXFDemux * demux)
for (i = 0; i < demux->preface->content_storage->n_packages; i++) { for (i = 0; i < demux->preface->content_storage->n_packages; i++) {
if (demux->preface->content_storage->packages[i] && if (demux->preface->content_storage->packages[i] &&
MXF_IS_METADATA_MATERIAL_PACKAGE (demux->preface-> MXF_IS_METADATA_MATERIAL_PACKAGE (demux->preface->content_storage->
content_storage->packages[i])) { packages[i])) {
ret = ret =
MXF_METADATA_GENERIC_PACKAGE (demux->preface-> MXF_METADATA_GENERIC_PACKAGE (demux->preface->content_storage->
content_storage->packages[i]); packages[i]);
break; break;
} }
} }
@ -1237,8 +1237,8 @@ gst_mxf_demux_pad_next_component (GstMXFDemux * demux, GstMXFDemuxPad * pad)
pad->current_component_index); pad->current_component_index);
pad->current_component = pad->current_component =
MXF_METADATA_SOURCE_CLIP (sequence-> MXF_METADATA_SOURCE_CLIP (sequence->structural_components[pad->
structural_components[pad->current_component_index]); current_component_index]);
if (pad->current_component == NULL) { if (pad->current_component == NULL) {
GST_ERROR_OBJECT (demux, "No such structural component"); GST_ERROR_OBJECT (demux, "No such structural component");
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
@ -1246,8 +1246,8 @@ gst_mxf_demux_pad_next_component (GstMXFDemux * demux, GstMXFDemuxPad * pad)
if (!pad->current_component->source_package if (!pad->current_component->source_package
|| !pad->current_component->source_package->top_level || !pad->current_component->source_package->top_level
|| !MXF_METADATA_GENERIC_PACKAGE (pad-> || !MXF_METADATA_GENERIC_PACKAGE (pad->current_component->
current_component->source_package)->tracks) { source_package)->tracks) {
GST_ERROR_OBJECT (demux, "Invalid component"); GST_ERROR_OBJECT (demux, "Invalid component");
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
@ -1582,7 +1582,6 @@ gst_mxf_demux_handle_index_table_segment (GstMXFDemux * demux,
if (!demux->current_partition->primer.mappings) { if (!demux->current_partition->primer.mappings) {
GST_WARNING_OBJECT (demux, "Invalid primer pack"); GST_WARNING_OBJECT (demux, "Invalid primer pack");
return GST_FLOW_OK;
} }
segment = g_new0 (MXFIndexTableSegment, 1); segment = g_new0 (MXFIndexTableSegment, 1);

View file

@ -868,9 +868,12 @@ mxf_index_table_segment_parse (const MXFUL * key,
break; break;
} }
default: default:
if (!mxf_local_tag_add_to_hash_table (primer, tag, tag_data, tag_size, if (!primer->mappings) {
&segment->other_tags)) GST_WARNING ("No valid primer pack for this partition");
} else if (!mxf_local_tag_add_to_hash_table (primer, tag, tag_data,
tag_size, &segment->other_tags)) {
goto error; goto error;
}
break; break;
} }