TRACKS_LOCK (demux);
+ /* Discard buffers that are received outside of a valid segment. This can
+ * happen if a flushing seek (which resets the track segment seqnums) was
+ * received but the stream is still providing buffers before returning.
+ */
+ if (track->input_segment_seqnum == GST_SEQNUM_INVALID) {
+ GST_DEBUG_OBJECT (pad,
+ "Dropping buffer because we do not have a valid input segment");
+ gst_buffer_unref (buffer);
+ TRACKS_UNLOCK (demux);
+ return GST_FLOW_OK;
+ }
+
ts = GST_BUFFER_DTS_OR_PTS (buffer);
/* Buffers coming out of parsebin *should* always be timestamped (it's the
return TRUE;
}
+ if (seg_seqnum != demux->priv->segment_seqnum) {
+ GST_DEBUG_OBJECT (pad, "Ignoring non-current segment");
+ gst_event_unref (event);
+ TRACKS_UNLOCK (demux);
+
+ return TRUE;
+ }
+
track->input_segment_seqnum = seg_seqnum;
gst_event_copy_segment (event, &track->input_segment);
if (track->input_segment.rate >= 0)