basesink: improve last_stop calculation

Only update the last_stop value when we had a valid stop position for the
clipping or else the clipping code assumes the stop position extends to the end
of the segment, which makes the position reporting return weird values.
This commit is contained in:
Wim Taymans 2010-12-14 19:00:14 +01:00
parent 4fd63f0ce2
commit 6da39bf508

View file

@ -1962,7 +1962,7 @@ again:
}
/* set last stop position */
if (G_LIKELY (cstop != GST_CLOCK_TIME_NONE))
if (G_LIKELY (stop != GST_CLOCK_TIME_NONE && cstop != GST_CLOCK_TIME_NONE))
gst_segment_set_last_stop (segment, GST_FORMAT_TIME, cstop);
else
gst_segment_set_last_stop (segment, GST_FORMAT_TIME, cstart);