splitmuxsink: When flushing, exit handle_mq_input quickly
If we just break the loop, we might run into the `gop != NULL` assert that follows it. Rather, exit immediately with flushing flow. Also use this flushing mechanism when we release a pad. This avoids having an extra flag. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1030>
This commit is contained in:
parent
fd27ee1537
commit
718d31fe63
@ -3081,17 +3081,14 @@ handle_mq_input (GstPad * pad, GstPadProbeInfo * info, MqStreamCtx * ctx)
|
|||||||
|
|
||||||
loop_again = TRUE;
|
loop_again = TRUE;
|
||||||
do {
|
do {
|
||||||
if (ctx->flushing)
|
if (ctx->flushing) {
|
||||||
break;
|
ret = GST_FLOW_FLUSHING;
|
||||||
|
goto beach;
|
||||||
|
}
|
||||||
|
|
||||||
switch (splitmux->input_state) {
|
switch (splitmux->input_state) {
|
||||||
case SPLITMUX_INPUT_STATE_COLLECTING_GOP_START:
|
case SPLITMUX_INPUT_STATE_COLLECTING_GOP_START:
|
||||||
if (ctx->is_releasing) {
|
if (ctx->is_reference) {
|
||||||
/* The pad belonging to this context is being released */
|
|
||||||
GST_WARNING_OBJECT (pad, "Pad is being released while the muxer is "
|
|
||||||
"running. Data might not drain correctly");
|
|
||||||
loop_again = FALSE;
|
|
||||||
} else if (ctx->is_reference) {
|
|
||||||
const InputGop *gop, *next_gop;
|
const InputGop *gop, *next_gop;
|
||||||
|
|
||||||
/* This is the reference context. If it's a keyframe,
|
/* This is the reference context. If it's a keyframe,
|
||||||
@ -3576,7 +3573,7 @@ gst_splitmux_sink_release_pad (GstElement * element, GstPad * pad)
|
|||||||
/* Remove the context from our consideration */
|
/* Remove the context from our consideration */
|
||||||
splitmux->contexts = g_list_remove (splitmux->contexts, ctx);
|
splitmux->contexts = g_list_remove (splitmux->contexts, ctx);
|
||||||
|
|
||||||
ctx->is_releasing = TRUE;
|
ctx->flushing = TRUE;
|
||||||
GST_SPLITMUX_BROADCAST_INPUT (splitmux);
|
GST_SPLITMUX_BROADCAST_INPUT (splitmux);
|
||||||
|
|
||||||
GST_SPLITMUX_UNLOCK (splitmux);
|
GST_SPLITMUX_UNLOCK (splitmux);
|
||||||
|
@ -104,7 +104,6 @@ typedef struct _MqStreamCtx
|
|||||||
gboolean out_eos_async_done;
|
gboolean out_eos_async_done;
|
||||||
gboolean need_unblock;
|
gboolean need_unblock;
|
||||||
gboolean caps_change;
|
gboolean caps_change;
|
||||||
gboolean is_releasing;
|
|
||||||
|
|
||||||
GstSegment in_segment;
|
GstSegment in_segment;
|
||||||
GstSegment out_segment;
|
GstSegment out_segment;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user