diff options
author | Stefan Sauer <ensonic@users.sf.net> | 2017-10-20 14:30:42 +0200 |
---|---|---|
committer | Stefan Sauer <ensonic@users.sf.net> | 2017-10-20 14:30:42 +0200 |
commit | f1baaae17557fa75a9bcd940b994597714be2f74 (patch) | |
tree | 52206b2ad52ef380ffd9499a2d3250d7986c4264 | |
parent | 875903be3f7e712052f5d0989e18ce1045c78eb7 (diff) |
segment: also intialize the duration
If start and stop are set, calculate the duration and set it too.
-rw-r--r-- | gst/gstsegment.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gst/gstsegment.c b/gst/gstsegment.c index f355d4aa7..f69c6f1dd 100644 --- a/gst/gstsegment.c +++ b/gst/gstsegment.c @@ -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; |