splitmuxsink: Only update max in/out running time if it's actually bigger

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1005>
This commit is contained in:
Sebastian Dröge 2021-09-16 13:02:29 +03:00 committed by GStreamer Marge Bot
parent 68683d15c4
commit eed843eea0

View file

@ -1344,7 +1344,12 @@ complete_or_wait_on_out (GstSplitMuxSink * splitmux, MqStreamCtx * ctx)
GST_STIME_ARGS (cmd->max_output_ts));
/* Extend the output range immediately */
if (splitmux->max_out_running_time == GST_CLOCK_STIME_NONE
|| cmd->max_output_ts > splitmux->max_out_running_time)
splitmux->max_out_running_time = cmd->max_output_ts;
GST_DEBUG_OBJECT (splitmux,
"Max out running time now %" GST_STIME_FORMAT,
GST_STIME_ARGS (splitmux->max_out_running_time));
splitmux->output_state = SPLITMUX_OUTPUT_STATE_OUTPUT_GOP;
}
GST_SPLITMUX_BROADCAST_OUTPUT (splitmux);
@ -2856,6 +2861,7 @@ handle_mq_input (GstPad * pad, GstPadProbeInfo * info, MqStreamCtx * ctx)
if (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT)) {
/* Allow other input pads to catch up to here too */
if (ctx->in_running_time > splitmux->max_in_running_time)
splitmux->max_in_running_time = ctx->in_running_time;
GST_LOG_OBJECT (splitmux,
"Max in running time now %" GST_TIME_FORMAT,
@ -2868,6 +2874,7 @@ handle_mq_input (GstPad * pad, GstPadProbeInfo * info, MqStreamCtx * ctx)
GST_STIME_ARGS (ctx->in_running_time));
keyframe = TRUE;
splitmux->input_state = SPLITMUX_INPUT_STATE_WAITING_GOP_COLLECT;
if (ctx->in_running_time > splitmux->max_in_running_time)
splitmux->max_in_running_time = ctx->in_running_time;
GST_LOG_OBJECT (splitmux, "Max in running time now %" GST_TIME_FORMAT,
GST_TIME_ARGS (splitmux->max_in_running_time));