From: Sebastian Dröge Date: Wed, 15 Apr 2020 10:21:05 +0000 (+0300) Subject: splitmuxsink: Fix off-by-one in running time comparison for split-at-running-time X-Git-Tag: 1.19.3~509^2~623 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ab0f92cac42b2d895950ec9470f60a1ebb301cb;p=platform%2Fupstream%2Fgstreamer.git splitmuxsink: Fix off-by-one in running time comparison for split-at-running-time If we get a keyframe exactly at the requested running time we would only split on the next keyframe afterwards due to wrong usage of > vs. >=. --- diff --git a/gst/multifile/gstsplitmuxsink.c b/gst/multifile/gstsplitmuxsink.c index 6d55a83..2ff0a42 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->reference_ctx->in_running_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->reference_ctx->in_running_time < time_to_split) { break; } gst_queue_array_pop_head_struct (splitmux->times_to_split);