From d75ea5b34021ab599ad825e4e9ef0550d5892fa8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 15 Apr 2020 17:50:31 +0300 Subject: [PATCH] splitmuxsink: Do split-at-running-time splitting based on the time of the start of the GOP If the start of the GOP is >= the requested running time, put it into a new fragment. That is, split-at-running-time would always ensure that a split happens as early as possible after the given running time. Previously it was comparing against the current incoming timestamp, which does not tell us what we actually want to know as it has no direct relation to the GOP start/end. --- gst/multifile/gstsplitmuxsink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst/multifile/gstsplitmuxsink.c b/gst/multifile/gstsplitmuxsink.c index 2ff0a42..ff78b83 100644 --- a/gst/multifile/gstsplitmuxsink.c +++ b/gst/multifile/gstsplitmuxsink.c @@ -2062,7 +2062,7 @@ need_new_fragment (GstSplitMuxSink * splitmux, } /* User told us to split at this running time */ - if (splitmux->reference_ctx->in_running_time >= time_to_split) { + if (splitmux->gop_start_time >= time_to_split) { GST_OBJECT_LOCK (splitmux); /* Dequeue running time */ gst_queue_array_pop_head_struct (splitmux->times_to_split); @@ -2070,7 +2070,7 @@ need_new_fragment (GstSplitMuxSink * splitmux, ptr_to_time = gst_queue_array_peek_head_struct (splitmux->times_to_split); while (ptr_to_time) { time_to_split = *ptr_to_time; - if (splitmux->reference_ctx->in_running_time < time_to_split) { + if (splitmux->gop_start_time < time_to_split) { break; } gst_queue_array_pop_head_struct (splitmux->times_to_split); -- 2.7.4