diff options
author | Jan Schmidt <jan@centricular.com> | 2016-09-29 04:55:14 +1000 |
---|---|---|
committer | Jan Schmidt <jan@centricular.com> | 2016-10-01 00:30:00 +1000 |
commit | 6da9c10fbe8e97f4b3b64f02a102ed7b5ec9747b (patch) | |
tree | 0596113cd5abe98eabbd768a03b8c263447acc0b | |
parent | f6ab2876aa76fb46fe61bbe4660716a4be85357f (diff) |
splitmuxsrc: Handle stop point from segment
If the seek stop point (or start, during reverse play)
was within the segment we just finished, go EOS immediately
instead of proceeding through all other parts and sending
0 length seeks to them.
https://bugzilla.gnome.org/show_bug.cgi?id=772138
-rw-r--r-- | gst/multifile/gstsplitmuxsrc.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gst/multifile/gstsplitmuxsrc.c b/gst/multifile/gstsplitmuxsrc.c index 0578f6264..4315583c5 100644 --- a/gst/multifile/gstsplitmuxsrc.c +++ b/gst/multifile/gstsplitmuxsrc.c @@ -921,6 +921,28 @@ gst_splitmux_end_of_part (GstSplitMuxSrc * splitmux, SplitMuxSrcPad * splitpad) if (gst_splitmux_part_is_eos (splitmux->parts[splitpad->cur_part])) gst_splitmux_part_reader_deactivate (splitmux->parts[cur_part]); + if (splitmux->play_segment.rate >= 0.0) { + if (splitmux->play_segment.stop != -1) { + GstClockTime part_end = + gst_splitmux_part_reader_get_end_offset (splitmux->parts[cur_part]); + if (part_end >= splitmux->play_segment.stop) { + GST_DEBUG_OBJECT (splitmux, + "Stop position was within that part. Finishing"); + next_part = -1; + } + } + } else { + if (splitmux->play_segment.start != -1) { + GstClockTime part_start = + gst_splitmux_part_reader_get_start_offset (splitmux->parts[cur_part]); + if (part_start >= splitmux->play_segment.start) { + GST_DEBUG_OBJECT (splitmux, + "Start position was within that part. Finishing"); + next_part = -1; + } + } + } + if (next_part != -1) { GST_DEBUG_OBJECT (splitmux, "At EOS on pad %" GST_PTR_FORMAT " moving to part %d", splitpad, next_part); |