splitmuxsink: Allow time and bytes to reach their respective thresholds
[platform/upstream/gst-plugins-good.git] / gst / multifile / gstsplitmuxsink.c
index f52dc67..98f744f 100644 (file)
@@ -902,9 +902,9 @@ handle_gathered_gop (GstSplitMuxSink * splitmux)
    * either threshold? */
   if ((splitmux->have_muxed_something &&
           ((splitmux->threshold_bytes > 0 &&
-                  queued_bytes >= splitmux->threshold_bytes) ||
+                  queued_bytes > splitmux->threshold_bytes) ||
               (splitmux->threshold_time > 0 &&
-                  queued_time >= splitmux->threshold_time)))) {
+                  queued_time > splitmux->threshold_time)))) {
 
     splitmux->state = SPLITMUX_STATE_ENDING_FILE;
 
@@ -1139,8 +1139,7 @@ handle_mq_input (GstPad * pad, GstPadProbeInfo * info, MqStreamCtx * ctx)
    * stream */
   if (GST_CLOCK_TIME_IS_VALID (ts)) {
     GstClockTimeDiff running_time =
-        my_segment_to_running_time (&ctx->in_segment,
-        GST_BUFFER_TIMESTAMP (buf));
+        my_segment_to_running_time (&ctx->in_segment, ts);
 
     GST_LOG_OBJECT (pad, "Buffer running TS is %" GST_STIME_FORMAT,
         GST_STIME_ARGS (running_time));