diff --git a/gst/multifile/gstsplitmuxsrc.c b/gst/multifile/gstsplitmuxsrc.c index df8eba2bc3..7f1ed653f7 100644 --- a/gst/multifile/gstsplitmuxsrc.c +++ b/gst/multifile/gstsplitmuxsrc.c @@ -428,6 +428,7 @@ gst_splitmux_handle_event (GstSplitMuxSrc * splitmux, break; } case GST_EVENT_SEGMENT:{ + GstClockTime duration; GstSegment seg; gst_event_copy_segment (event, &seg); @@ -462,6 +463,15 @@ gst_splitmux_handle_event (GstSplitMuxSrc * splitmux, } } + GST_OBJECT_LOCK (splitmux); + duration = splitmux->total_duration; + GST_OBJECT_UNLOCK (splitmux); + + if (duration > 0) + seg.duration = duration; + else + seg.duration = GST_CLOCK_TIME_NONE; + GST_INFO_OBJECT (splitpad, "Forwarding segment %" GST_SEGMENT_FORMAT, &seg);