From cffc0f920726841aa7c41bd418402adae5812488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 1 Dec 2008 14:25:19 +0000 Subject: [PATCH] gst/mxf/mxfdemux.c: If the preface references a primary package use this as the default playback package unless one w... Original commit message from CVS: * gst/mxf/mxfdemux.c: (gst_mxf_demux_choose_package): If the preface references a primary package use this as the default playback package unless one was specified by the "package" property. If there's no preface primary package still try to use the first material package. --- ChangeLog | 8 ++++++++ common | 2 +- gst/mxf/mxfdemux.c | 11 ++++++++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7cb9ccdc02..a7a862110a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-12-01 Sebastian Dröge + + * gst/mxf/mxfdemux.c: (gst_mxf_demux_choose_package): + If the preface references a primary package use this as the default + playback package unless one was specified by the "package" property. + If there's no preface primary package still try to use the first + material package. + 2008-11-30 Sebastian Dröge * gst/mxf/mxfdemux.c: diff --git a/common b/common index 5596f3e948..24963a683c 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 5596f3e94835309b54029096f8bba528d79ae677 +Subproject commit 24963a683c185e1405b6f0aad37d95064cced93b diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c index 33be437886..1bc0e7bfd6 100644 --- a/gst/mxf/mxfdemux.c +++ b/gst/mxf/mxfdemux.c @@ -1305,9 +1305,8 @@ gst_mxf_demux_handle_header_metadata_resolve_references (GstMXFDemux * demux) MXFMetadataEssenceContainerData, i); for (j = 0; j < demux->content_storage.n_essence_container_data; j++) { - if (mxf_ul_is_equal (&demux-> - content_storage.essence_container_data_uids[j], - &data->instance_uid)) { + if (mxf_ul_is_equal (&demux->content_storage. + essence_container_data_uids[j], &data->instance_uid)) { demux->content_storage.essence_container_data[j] = data; break; } @@ -1677,6 +1676,12 @@ gst_mxf_demux_choose_package (GstMXFDemux * demux) GST_WARNING_OBJECT (demux, "Current package not found, choosing the first best"); + if (demux->preface.primary_package) + ret = demux->preface.primary_package; + if (ret && (ret->type == MXF_METADATA_GENERIC_PACKAGE_TOP_LEVEL_SOURCE + || ret->type == MXF_METADATA_GENERIC_PACKAGE_MATERIAL)) + return ret; + if (!demux->material_package) { GST_ERROR_OBJECT (demux, "No material package"); return NULL;