From a40eacabb466834e20321c02da62624fac481ab8 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Wed, 25 Mar 2020 21:20:07 +0900 Subject: [PATCH] splitmuxsink: Split fragment only if queued time is larger than threshold The queued time includes the duration of the last queued frame (i.e., new keyframe) so the condition check should not be inclusive. Note that the new fragment will be cut excluding the last frame and therefore if the condition is inclusive way, the fragment might have one frame shorter duration for all keyframe stream such as jpeg or all-inter video streams. --- gst/multifile/gstsplitmuxsink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/multifile/gstsplitmuxsink.c b/gst/multifile/gstsplitmuxsink.c index 8f193b618b..6351840bcc 100644 --- a/gst/multifile/gstsplitmuxsink.c +++ b/gst/multifile/gstsplitmuxsink.c @@ -2082,7 +2082,7 @@ need_new_fragment (GstSplitMuxSink * splitmux, /* 5us possible rounding error was already accounted around keyframe request */ if (splitmux->threshold_timecode != GST_CLOCK_TIME_NONE && - (queued_time >= splitmux->threshold_timecode)) { + (queued_time > splitmux->threshold_timecode)) { GST_TRACE_OBJECT (splitmux, "Splitting at timecode mark"); return TRUE; /* Timecode threshold */ }