continue;
case SPLITMUX_OUTPUT_STATE_ENDING_FILE:
+ case SPLITMUX_OUTPUT_STATE_ENDING_STREAM:
/* We've reached the max out running_time to get here, so end this file now */
if (ctx->out_eos == FALSE) {
if (splitmux->async_finalize) {
if (splitmux->output_state == SPLITMUX_OUTPUT_STATE_STOPPED)
goto beach;
ctx->out_eos = TRUE;
+
+ if (ctx == splitmux->reference_ctx) {
+ splitmux->output_state = SPLITMUX_OUTPUT_STATE_ENDING_STREAM;
+ GST_SPLITMUX_BROADCAST_OUTPUT (splitmux);
+ }
+
GST_INFO_OBJECT (splitmux,
"Have EOS event at pad %" GST_PTR_FORMAT " ctx %p", pad, ctx);
break;
GST_SPLITMUX_UNLOCK (splitmux);
return;
}
- } else if (splitmux->output_state == SPLITMUX_OUTPUT_STATE_ENDING_FILE) {
+ } else if (splitmux->output_state == SPLITMUX_OUTPUT_STATE_ENDING_STREAM) {
+ GST_DEBUG_OBJECT (splitmux,
+ "Passing EOS message. Output state %d max_out_running_time %"
+ GST_STIME_FORMAT, splitmux->output_state,
+ GST_STIME_ARGS (splitmux->max_out_running_time));
+ } else {
GST_DEBUG_OBJECT (splitmux, "Caught EOS at end of fragment, dropping");
splitmux->output_state = SPLITMUX_OUTPUT_STATE_START_NEXT_FILE;
GST_SPLITMUX_BROADCAST_OUTPUT (splitmux);
gst_message_unref (message);
GST_SPLITMUX_UNLOCK (splitmux);
return;
- } else {
- GST_DEBUG_OBJECT (splitmux,
- "Passing EOS message. Output state %d max_out_running_time %"
- GST_STIME_FORMAT, splitmux->output_state,
- GST_STIME_ARGS (splitmux->max_out_running_time));
}
GST_SPLITMUX_UNLOCK (splitmux);
break;
SPLITMUX_OUTPUT_STATE_AWAITING_COMMAND, /* Waiting first command packet from input */
SPLITMUX_OUTPUT_STATE_OUTPUT_GOP, /* Outputting a collected GOP */
SPLITMUX_OUTPUT_STATE_ENDING_FILE, /* Finishing the current fragment */
+ SPLITMUX_OUTPUT_STATE_ENDING_STREAM, /* Finishing up the entire stream due to input EOS */
SPLITMUX_OUTPUT_STATE_START_NEXT_FILE /* Restarting after ENDING_FILE */
} SplitMuxOutputState;