Player: fix crash when no action is present in the file

It can happen if the file doesn't contain any actions or if no shot is
present. In this last case, an optimization in the player removes the
actions after the last shot, meaning it will remove all the actions if
no shot is present.

An example is window_states_2 test where the shots cannot be taken by
the recorder, as F2 is not caught.
master
Daniel Zaoui 4 years ago
parent 3f31c8f72e
commit b6bd7ecdf0
  1. 4
      src/bin/player.c

@ -538,7 +538,7 @@ static Eina_Bool
_feed_event_timer_cb(void *data EINA_UNUSED)
{
Exactness_Action *act = eina_list_data_get(_cur_event_list);
_feed_event(act->type, act->n_evas, act->data);
if (act) _feed_event(act->type, act->n_evas, act->data);
_cur_event_list = eina_list_next(_cur_event_list);
if (!_cur_event_list)
@ -780,7 +780,7 @@ _src_feed(void *data EINA_UNUSED)
_cur_event_list = _src_unit->actions;
Exactness_Action *act = eina_list_data_get(_cur_event_list);
if (act->delay_ms)
if (act && act->delay_ms)
{
_printf(2, " Waiting <%f>\n", act->delay_ms / 1000.0);
ecore_timer_add(act->delay_ms / 1000.0, _feed_event_timer_cb, NULL);

Loading…
Cancel
Save