diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-02-04 10:59:53 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-02-04 11:12:13 +0100 |
commit | c0557df34d85b9886913ee470b8c97355ced074c (patch) | |
tree | b8ea8f794fc6cbf7e931cf23d7ca6cb1e3a0aa7c | |
parent | 2ee7e7768de36f4e8dff575997eb670371660483 (diff) | |
download | gst-plugins-bad-c0557df34d85b9886913ee470b8c97355ced074c.tar.gz gst-plugins-bad-c0557df34d85b9886913ee470b8c97355ced074c.tar.bz2 gst-plugins-bad-c0557df34d85b9886913ee470b8c97355ced074c.zip |
Reset the current partition after seeking and NEWSEGMENT events
-rw-r--r-- | gst/mxf/mxfdemux.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c index 51a11a94..dcef0e04 100644 --- a/gst/mxf/mxfdemux.c +++ b/gst/mxf/mxfdemux.c @@ -2235,7 +2235,7 @@ gst_mxf_demux_set_partition_for_offset (GstMXFDemux * demux, guint64 offset) for (l = demux->partitions; l; l = l->next) { GstMXFDemuxPartition *p = l->data; - if (p->partition.this_partition <= offset) + if (p->partition.this_partition + demux->run_in <= offset) demux->current_partition = p; } } @@ -2676,6 +2676,9 @@ gst_mxf_demux_chain (GstPad * pad, GstBuffer * inbuf) if (G_UNLIKELY (demux->offset == 0 && GST_BUFFER_OFFSET (inbuf) != 0)) { GST_DEBUG_OBJECT (demux, "offset was zero, synchronizing with buffer's"); demux->offset = GST_BUFFER_OFFSET (inbuf); + gst_mxf_demux_set_partition_for_offset (demux, demux->offset); + } else if (demux->current_partition == NULL) { + gst_mxf_demux_set_partition_for_offset (demux, demux->offset); } gst_adapter_push (demux->adapter, inbuf); @@ -3094,6 +3097,7 @@ gst_mxf_demux_seek_pull (GstMXFDemux * demux, GstEvent * event) goto no_new_offset; demux->offset = new_offset + demux->run_in; + gst_mxf_demux_set_partition_for_offset (demux, demux->offset); } if (G_UNLIKELY (demux->close_seg_event)) { @@ -3436,6 +3440,7 @@ gst_mxf_demux_sink_event (GstPad * pad, GstEvent * event) t->position = -1; } } + demux->current_partition = NULL; gst_event_unref (event); ret = TRUE; break; |