diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-02-08 21:52:03 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-02-08 21:52:03 +0100 |
commit | f169201c24798f950e243f0a9e048a587edd6295 (patch) | |
tree | 1677e6e27fe796810a264cd70ccde3f8ed2b09a8 /gst | |
parent | 33baa707a28fc0559670f05a5181733c6a6d8482 (diff) | |
download | gst-plugins-bad-f169201c24798f950e243f0a9e048a587edd6295.tar.gz gst-plugins-bad-f169201c24798f950e243f0a9e048a587edd6295.tar.bz2 gst-plugins-bad-f169201c24798f950e243f0a9e048a587edd6295.zip |
mxfdemux: Fix last_stop calculation when seeking
Diffstat (limited to 'gst')
-rw-r--r-- | gst/mxf/mxfdemux.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c index bb2f4f19..2ae94a41 100644 --- a/gst/mxf/mxfdemux.c +++ b/gst/mxf/mxfdemux.c @@ -2894,7 +2894,7 @@ gst_mxf_demux_pad_set_last_stop (GstMXFDemux * demux, GstMXFDemuxPad * p, GstClockTime sum = 0; MXFMetadataSourceClip *clip = NULL; - if (!MXF_IS_METADATA_MATERIAL_PACKAGE (demux->current_package)) { + if (!p->current_component) { p->current_essence_track_position = gst_util_uint64_scale (start, p->material_track->edit_rate.n, p->material_track->edit_rate.d * GST_SECOND); @@ -2949,19 +2949,23 @@ gst_mxf_demux_pad_set_last_stop (GstMXFDemux * demux, GstMXFDemuxPad * p, p->material_track->edit_rate.n); start -= sum; - p->last_stop = sum + gst_util_uint64_scale (start, - GST_SECOND * p->material_track->edit_rate.d, - p->material_track->edit_rate.n);; - p->last_stop_accumulated_error = 0.0; if (gst_mxf_demux_pad_set_component (demux, p, i) != GST_FLOW_OK) { p->eos = TRUE; } - p->current_essence_track_position += - gst_util_uint64_scale (start, - p->current_essence_track->source_track->edit_rate.n, - p->current_essence_track->source_track->edit_rate.d * GST_SECOND); + { + gint64 essence_offset = gst_util_uint64_scale (start, + p->current_essence_track->source_track->edit_rate.n, + p->current_essence_track->source_track->edit_rate.d * GST_SECOND); + + p->current_essence_track_position += essence_offset; + + p->last_stop = sum + gst_util_uint64_scale (essence_offset, + GST_SECOND * p->material_track->edit_rate.d, + p->material_track->edit_rate.n); + p->last_stop_accumulated_error = 0.0; + } if (p->current_essence_track_position >= p->current_essence_track->duration && p->current_essence_track->duration > 0) { |