gboolean can_output = (ctx->is_reference || splitmux->ready_for_output);
GstClockTimeDiff my_max_out_running_time = splitmux->max_out_running_time;
- if (!(splitmux->max_out_running_time == 0 ||
- splitmux->max_out_running_time == GST_CLOCK_STIME_NONE ||
- splitmux->alignment_threshold == 0 ||
- splitmux->max_out_running_time < splitmux->alignment_threshold)) {
+ if (my_max_out_running_time != GST_CLOCK_STIME_NONE
+ && my_max_out_running_time != G_MAXINT64) {
my_max_out_running_time -= splitmux->alignment_threshold;
GST_LOG_OBJECT (ctx->srcpad,
"Max out running time currently %" GST_STIME_FORMAT
GST_STIME_ARGS (my_max_out_running_time));
if (can_output) {
- if (splitmux->max_out_running_time == GST_CLOCK_STIME_NONE ||
+ if (splitmux->max_out_running_time != GST_CLOCK_STIME_NONE &&
ctx->out_running_time < my_max_out_running_time) {
return GST_FLOW_OK;
}
} else {
/* This is probably already the current state, but just in case: */
splitmux->input_state = SPLITMUX_INPUT_STATE_FINISHING_UP;
- new_out_ts = GST_CLOCK_STIME_NONE; /* EOS runs until forever */
+ new_out_ts = G_MAXINT64; /* EOS runs until forever */
}
/* And wake all input contexts to send a wake-up event */
splitmux->max_in_running_time = GST_CLOCK_STIME_NONE;
splitmux->gop_start_time = splitmux->fragment_start_time =
GST_CLOCK_STIME_NONE;
- splitmux->max_out_running_time = 0;
+ splitmux->max_out_running_time = GST_CLOCK_STIME_NONE;
splitmux->fragment_total_bytes = 0;
splitmux->fragment_reference_bytes = 0;
splitmux->gop_total_bytes = 0;