videomixer: check last end_time after conversion to running segment

The last end_time was saved after conversion, so the comparison
had to be made after conversion for it to make sense.

https://bugzilla.gnome.org/show_bug.cgi?id=701385
This commit is contained in:
Mathieu Duponchelle 2013-06-11 19:24:49 +02:00 committed by Sebastian Dröge
parent 4243714301
commit 6e23f1fec4

View file

@ -707,21 +707,6 @@ gst_videomixer2_fill_queues (GstVideoMixer2 * mix,
g_assert (start_time != -1 && end_time != -1);
end_time += start_time; /* convert from duration to position */
if (mixcol->end_time != -1 && mixcol->end_time > end_time) {
GST_WARNING_OBJECT (pad, "Buffer from the past, dropping");
if (buf == mixcol->queued) {
gst_buffer_unref (buf);
gst_buffer_replace (&mixcol->queued, NULL);
} else {
gst_buffer_unref (buf);
buf = gst_collect_pads_pop (mix->collect, &mixcol->collect);
gst_buffer_unref (buf);
}
need_more_data = TRUE;
continue;
}
/* Check if it's inside the segment */
if (start_time >= segment->stop || end_time < segment->start) {
GST_DEBUG_OBJECT (pad, "Buffer outside the segment");
@ -755,6 +740,21 @@ gst_videomixer2_fill_queues (GstVideoMixer2 * mix,
end_time *= ABS (mix->segment.rate);
}
if (mixcol->end_time != -1 && mixcol->end_time > end_time) {
GST_DEBUG_OBJECT (pad, "Buffer from the past, dropping");
if (buf == mixcol->queued) {
gst_buffer_unref (buf);
gst_buffer_replace (&mixcol->queued, NULL);
} else {
gst_buffer_unref (buf);
buf = gst_collect_pads_pop (mix->collect, &mixcol->collect);
gst_buffer_unref (buf);
}
need_more_data = TRUE;
continue;
}
if (end_time >= output_start_time && start_time < output_end_time) {
GST_DEBUG_OBJECT (pad,
"Taking new buffer with start time %" GST_TIME_FORMAT,