validate:scenario: Clear up last seek on EOS generating a 'stop' action

Otherwise there is a race leading to a segfault where ASYNC_DONE is
received *after* generating EOS ourselves:

```
Executing stop (
    - generated-after-eos=true
)
<Caught SIGNAL: SIGSEGV>

**Stack trace**:

...
Thread 1 (Thread 0x7f3c3e50df00 (LWP 10183)):
    #8  0x00007f3c3f01bea5 in g_cclosure_marshal_generic (closure=<optimized out>, return_gvalue=<optimized out>, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized out>, marshal_data=<optimized out>) at gclosure.c:1496
    #9  0x00007f3c3f01b3dd in g_closure_invoke (closure=0x1855980, return_value=0x0, n_param_values=2, param_values=0x7ffda2e0a7e0, invocation_hint=0x7ffda2e0a760) at gclosure.c:810
    #10 0x00007f3c3f02e983 in signal_emit_unlocked_R (node=node@entry=0x15af670, detail=detail@entry=298, instance=instance@entry=0x171fc80, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffda2e0a7e0) at gsignal.c:3635
    #11 0x00007f3c3f037aaa in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffda2e0a9c0) at gsignal.c:3391
[Inferior 1 (process 10183) detached]

```
This commit is contained in:
Thibault Saunier 2019-03-19 10:22:26 -03:00 committed by Thibault Saunier
parent 0a2af1b027
commit 48fa4b6c4b

View file

@ -3232,6 +3232,9 @@ message_cb (GstBus * bus, GstMessage * message, GstValidateScenario * scenario)
}
g_free (actions);
}
/* Make sure that if there is an ASYNC_DONE in the message queue, we do not
take it into account */
gst_event_replace (&priv->last_seek, NULL);
SCENARIO_UNLOCK (scenario);
GST_DEBUG_OBJECT (scenario, "Got EOS; generate 'stop' action");