summaryrefslogtreecommitdiffstats
path: root/gst/mxf
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-02-06 10:46:09 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-02-06 10:46:09 +0100
commitbb11522f1d9d8eb0ba9bf22056e1a51b502c351e (patch)
tree50b4313ed26b2d47a048c45fe329b0a00f4af3ed /gst/mxf
parent22cb259f197c91d8d6e339bb765a74c023fc7775 (diff)
downloadgst-plugins-bad-bb11522f1d9d8eb0ba9bf22056e1a51b502c351e.tar.gz
gst-plugins-bad-bb11522f1d9d8eb0ba9bf22056e1a51b502c351e.tar.bz2
gst-plugins-bad-bb11522f1d9d8eb0ba9bf22056e1a51b502c351e.zip
mxfdemux: Adjust last_stop to the last keyframe when seeking
Diffstat (limited to 'gst/mxf')
-rw-r--r--gst/mxf/mxfdemux.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c
index 9cbbc2b0..16eb8a02 100644
--- a/gst/mxf/mxfdemux.c
+++ b/gst/mxf/mxfdemux.c
@@ -2827,7 +2827,7 @@ gst_mxf_demux_chain (GstPad * pad, GstBuffer * inbuf)
}
static void
-gst_mxf_demux_pad_set_position (GstMXFDemux * demux, GstMXFDemuxPad * p,
+gst_mxf_demux_pad_set_last_stop (GstMXFDemux * demux, GstMXFDemuxPad * p,
GstClockTime start)
{
guint i;
@@ -2958,7 +2958,7 @@ gst_mxf_demux_seek_push (GstMXFDemux * demux, GstEvent * event)
/* Reset EOS flag on all pads */
p->eos = FALSE;
p->last_flow = GST_FLOW_OK;
- gst_mxf_demux_pad_set_position (demux, p, start);
+ gst_mxf_demux_pad_set_last_stop (demux, p, start);
position = p->current_essence_track_position;
off = gst_mxf_demux_find_essence_element (demux, p->current_essence_track,
@@ -3106,7 +3106,7 @@ gst_mxf_demux_seek_pull (GstMXFDemux * demux, GstEvent * event)
/* Reset EOS flag on all pads */
p->eos = FALSE;
p->last_flow = GST_FLOW_OK;
- gst_mxf_demux_pad_set_position (demux, p, start);
+ gst_mxf_demux_pad_set_last_stop (demux, p, start);
position = p->current_essence_track_position;
off =
@@ -3118,6 +3118,12 @@ gst_mxf_demux_seek_pull (GstMXFDemux * demux, GstEvent * event)
p->eos = TRUE;
} else {
new_offset = MIN (off, new_offset);
+ if (position != p->current_essence_track_position) {
+ p->last_flow -=
+ gst_util_uint64_scale (p->current_essence_track_position -
+ position, GST_SECOND * p->material_track->edit_rate.d,
+ p->material_track->edit_rate.d);
+ }
p->current_essence_track_position = position;
}
p->discont = TRUE;