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.
This commit is contained in:
Sebastian Dröge 2020-04-15 17:50:31 +03:00
parent 0ab0f92cac
commit d75ea5b340

View file

@ -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);