summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-01-30 19:52:59 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-01-31 11:02:26 +0100
commit93a2b5c9ea17c328da4bac3b1bf3e87c65d2ba44 (patch)
tree9763e9438b9ba55ce53b1d0c2e435511ef9a5887
parentebd8b8dbaf5c5c6e938e0bbe05afe25cccd24e1a (diff)
downloadgst-plugins-bad-93a2b5c9ea17c328da4bac3b1bf3e87c65d2ba44.tar.gz
gst-plugins-bad-93a2b5c9ea17c328da4bac3b1bf3e87c65d2ba44.tar.bz2
gst-plugins-bad-93a2b5c9ea17c328da4bac3b1bf3e87c65d2ba44.zip
Check for EOS on all pads after adjusting the essence track durations
-rw-r--r--gst/mxf/mxfdemux.c39
1 files changed, 31 insertions, 8 deletions
diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c
index 8eca074f..1afab1e2 100644
--- a/gst/mxf/mxfdemux.c
+++ b/gst/mxf/mxfdemux.c
@@ -632,11 +632,11 @@ gst_mxf_demux_choose_package (GstMXFDemux * demux)
for (i = 0; i < demux->preface->content_storage->n_packages; i++) {
if (demux->preface->content_storage->packages[i] &&
- MXF_IS_METADATA_MATERIAL_PACKAGE (demux->preface->
- content_storage->packages[i])) {
+ MXF_IS_METADATA_MATERIAL_PACKAGE (demux->preface->content_storage->
+ packages[i])) {
ret =
- MXF_METADATA_GENERIC_PACKAGE (demux->preface->
- content_storage->packages[i]);
+ MXF_METADATA_GENERIC_PACKAGE (demux->preface->content_storage->
+ packages[i]);
break;
}
}
@@ -1280,8 +1280,8 @@ gst_mxf_demux_pad_next_component (GstMXFDemux * demux, GstMXFDemuxPad * pad)
pad->current_component_index);
pad->current_component =
- MXF_METADATA_SOURCE_CLIP (sequence->
- structural_components[pad->current_component_index]);
+ MXF_METADATA_SOURCE_CLIP (sequence->structural_components[pad->
+ current_component_index]);
if (pad->current_component == NULL) {
GST_ERROR_OBJECT (demux, "No such structural component");
return GST_FLOW_ERROR;
@@ -1289,8 +1289,8 @@ gst_mxf_demux_pad_next_component (GstMXFDemux * demux, GstMXFDemuxPad * pad)
if (!pad->current_component->source_package
|| !pad->current_component->source_package->top_level
- || !MXF_METADATA_GENERIC_PACKAGE (pad->
- current_component->source_package)->tracks) {
+ || !MXF_METADATA_GENERIC_PACKAGE (pad->current_component->
+ source_package)->tracks) {
GST_ERROR_OBJECT (demux, "Invalid component");
return GST_FLOW_ERROR;
}
@@ -2272,6 +2272,17 @@ from_index:
}
/* For the searched track this is really our position */
etrack->duration = etrack->position;
+
+ for (i = 0; i < demux->src->len; i++) {
+ GstMXFDemuxPad *p = g_ptr_array_index (demux->src, i);
+
+ if (!p->eos
+ && p->current_essence_track_position >=
+ p->current_essence_track->duration) {
+ p->eos = TRUE;
+ gst_pad_push_event (GST_PAD_CAST (p), gst_event_new_eos ());
+ }
+ }
}
if (G_UNLIKELY (ret != GST_FLOW_OK))
@@ -2334,6 +2345,18 @@ gst_mxf_demux_pull_and_handle_klv_packet (GstMXFDemux * demux)
t->duration = t->position;
}
+
+ for (i = 0; i < demux->src->len; i++) {
+ GstMXFDemuxPad *p = g_ptr_array_index (demux->src, i);
+
+ if (!p->eos
+ && p->current_essence_track_position >=
+ p->current_essence_track->duration) {
+ p->eos = TRUE;
+ gst_pad_push_event (GST_PAD_CAST (p), gst_event_new_eos ());
+ }
+ }
+
while ((p = gst_mxf_demux_get_earliest_pad (demux))) {
guint64 offset;
gint64 position;