Commit 168f57e 1 parent 4d8691c commit 168f57e Copy full SHA for 168f57e
File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -256,7 +256,20 @@ defmodule Membrane.Core.Element do
256
256
end
257
257
258
258
defp do_handle_info ( Message . new ( :timer_tick , timer_id ) , state ) do
259
+ # Guarding the `TimerController.handle_tick/2` invocation is
260
+ # required since there might be a case in which `handle_tick`
261
+ # callback's implementation returns demand action.
262
+ # In this scenario, without this guard, there would a possibility that
263
+ # the `handle_buffer` would be called immediately, returning
264
+ # some action that would affect the timer and the original state
265
+ # of the timer, set with actions returned from `handle_tick`,
266
+ # would be overwritten with that action.
267
+ #
268
+ # For more information see: https://github.com/membraneframework/membrane_core/issues/670
269
+ state = % { state | supplying_demand?: true }
259
270
state = TimerController . handle_tick ( timer_id , state )
271
+ state = % { state | supplying_demand?: false }
272
+ state = Membrane.Core.Element.DemandHandler . handle_delayed_demands ( state )
260
273
{ :noreply , state }
261
274
end
262
275
You can’t perform that action at this time.
0 commit comments