diff options
Diffstat (limited to 'gst')
-rw-r--r-- | gst/mxf/mxfdemux.c | 12 | ||||
-rw-r--r-- | gst/mxf/mxfdemux.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c index 63cd1ac9..64bbf7fb 100644 --- a/gst/mxf/mxfdemux.c +++ b/gst/mxf/mxfdemux.c @@ -1534,6 +1534,18 @@ gst_mxf_demux_handle_generic_container_essence_element (GstMXFDemux * demux, GST_BUFFER_OFFSET (outbuf) = GST_BUFFER_OFFSET_NONE; GST_BUFFER_OFFSET_END (outbuf) = GST_BUFFER_OFFSET_NONE; + /* Update accumulated error and compensate */ + { + guint64 abs_error = (GST_SECOND * pad->material_track->edit_rate.d) % + pad->material_track->edit_rate.n; + pad->last_stop_accumulated_error += + ((gdouble) abs_error) / ((gdouble) pad->material_track->edit_rate.n); + } + if (pad->last_stop_accumulated_error >= 1.0) { + GST_BUFFER_DURATION (outbuf) += 1; + pad->last_stop_accumulated_error -= 1.0; + } + if (pad->need_segment) { gst_pad_push_event (GST_PAD_CAST (pad), gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_TIME, 0, -1, diff --git a/gst/mxf/mxfdemux.h b/gst/mxf/mxfdemux.h index e431e306..0a4f8b83 100644 --- a/gst/mxf/mxfdemux.h +++ b/gst/mxf/mxfdemux.h @@ -93,6 +93,7 @@ struct _GstMXFDemuxPad gboolean need_segment; GstClockTime last_stop; + gdouble last_stop_accumulated_error; GstFlowReturn last_flow; gboolean eos, discont; |