segment: also intialize the duration

If start and stop are set, calculate the duration and set it too.
This commit is contained in:
Stefan Sauer 2017-10-20 14:30:42 +02:00
parent 875903be3f
commit f1baaae175

View file

@ -364,6 +364,12 @@ gst_segment_do_seek (GstSegment * segment, gdouble rate,
segment->offset = 0;
}
if (start != -1 && stop != -1) {
segment->duration = stop - start;
} else {
segment->duration = -1;
}
segment->start = start;
segment->stop = stop;
segment->time = start;