Skip to content

Commit

Permalink
Comment out handling_action? flag
Browse files Browse the repository at this point in the history
  • Loading branch information
FelonEkonom committed Mar 21, 2024
1 parent 0143b79 commit 187b205
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions lib/membrane/core/bin/state.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ defmodule Membrane.Core.Bin.State do
terminating?: boolean(),
resource_guard: Membrane.ResourceGuard.t(),
setup_incomplete?: boolean(),
handling_action?: boolean(),
# handling_action?: boolean(),
stalker: Membrane.Core.Stalker.t()
}

Expand Down Expand Up @@ -73,7 +73,7 @@ defmodule Membrane.Core.Bin.State do
initialized?: false,
terminating?: false,
setup_incomplete?: false,
handling_action?: false,
# handling_action?: false,
stalker: nil,
resource_guard: nil,
subprocess_supervisor: nil,
Expand Down
12 changes: 6 additions & 6 deletions lib/membrane/core/callback_handler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ defmodule Membrane.Core.CallbackHandler do
reraise e, __STACKTRACE__
end

was_handling_action? = state.handling_action?
state = %{state | handling_action?: true}
# was_handling_action? = state.handling_action?
# state = %{state | handling_action?: true}

# Updating :supplying_demand? flag value here is a temporal fix.
# Setting it to `true` while handling actions causes postponing calls
Expand All @@ -213,10 +213,10 @@ defmodule Membrane.Core.CallbackHandler do
end
end)

state =
if was_handling_action?,
do: state,
else: %{state | handling_action?: false}
# state =
# if was_handling_action?,
# do: state,
# else: %{state | handling_action?: false}

state =
if Component.is_element?(state) and not was_supplying_demand?,
Expand Down
4 changes: 2 additions & 2 deletions lib/membrane/core/element/action_handler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ defmodule Membrane.Core.Element.ActionHandler do
end

defp maybe_handle_pads_to_snapshot(state) do
with %{handling_action?: false} <- state do
# with %{handling_action?: false} <- state do
Enum.reduce(state.pads_to_snapshot, state, &DemandController.snapshot_atomic_demand/2)
|> Map.put(:pads_to_snapshot, MapSet.new())
end
# end
end

@impl CallbackHandler
Expand Down
4 changes: 2 additions & 2 deletions lib/membrane/core/element/state.ex
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ defmodule Membrane.Core.Element.State do
terminating?: boolean(),
setup_incomplete?: boolean(),
effective_flow_control: EffectiveFlowController.effective_flow_control(),
handling_action?: boolean(),
# handling_action?: boolean(),
popping_auto_flow_queue?: boolean(),
pads_to_snapshot: MapSet.t(),
stalker: Membrane.Core.Stalker.t(),
Expand Down Expand Up @@ -75,7 +75,7 @@ defmodule Membrane.Core.Element.State do
terminating?: false,
setup_incomplete?: false,
supplying_demand?: false,
handling_action?: false,
# handling_action?: false,
popping_auto_flow_queue?: false,
stalker: nil,
resource_guard: nil,
Expand Down
4 changes: 2 additions & 2 deletions lib/membrane/core/pipeline/state.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ defmodule Membrane.Core.Pipeline.State do
terminating?: boolean(),
resource_guard: Membrane.ResourceGuard.t(),
setup_incomplete?: boolean(),
handling_action?: boolean(),
# handling_action?: boolean(),
stalker: Membrane.Core.Stalker.t(),
subprocess_supervisor: pid(),
awaiting_setup_completition?: boolean()
Expand All @@ -56,7 +56,7 @@ defmodule Membrane.Core.Pipeline.State do
initialized?: false,
terminating?: false,
setup_incomplete?: false,
handling_action?: false,
# handling_action?: false,
stalker: nil,
resource_guard: nil,
subprocess_supervisor: nil,
Expand Down
6 changes: 3 additions & 3 deletions test/membrane/core/element/action_handler_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule Membrane.Core.Element.ActionHandlerTest do
playback: :stopped,
synchronization: %{clock: nil, parent_clock: nil},
delayed_demands: MapSet.new(),
handling_action?: false,
# handling_action?: false,
pads_to_snapshot: MapSet.new(),
pads_data: %{
input:
Expand Down Expand Up @@ -110,7 +110,7 @@ defmodule Membrane.Core.Element.ActionHandlerTest do
synchronization: %{clock: nil, parent_clock: nil},
delayed_demands: MapSet.new(),
playback: :stopped,
handling_action?: false,
# handling_action?: false,
pads_to_snapshot: MapSet.new(),
pads_data: %{
output: %{
Expand Down Expand Up @@ -512,7 +512,7 @@ defmodule Membrane.Core.Element.ActionHandlerTest do
name: :elem_name,
synchronization: %{clock: nil, parent_clock: nil},
type: :source,
handling_action?: false,
# handling_action?: false,
pads_to_snapshot: MapSet.new(),
pads_data: %{
output: %{
Expand Down
2 changes: 1 addition & 1 deletion test/membrane/core/element/event_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ defmodule Membrane.Core.Element.EventControllerTest do
playback: :playing,
parent_pid: self(),
synchronization: %{clock: nil, parent_clock: nil, stream_sync: nil},
handling_action?: false,
# handling_action?: false,
supplying_demand?: false,
pads_to_snapshot: MapSet.new(),
delayed_demands: MapSet.new(),
Expand Down
2 changes: 1 addition & 1 deletion test/membrane/core/element/lifecycle_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ defmodule Membrane.Core.Element.LifecycleControllerTest do
playback: :playing,
parent_pid: self(),
synchronization: %{clock: nil, parent_clock: nil},
handling_action?: false,
# handling_action?: false,
supplying_demand?: false,
pads_to_snapshot: MapSet.new(),
delayed_demands: MapSet.new(),
Expand Down
2 changes: 1 addition & 1 deletion test/membrane/core/element/pad_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ defmodule Membrane.Core.Element.PadControllerTest do
struct!(State,
name: name,
module: elem_module,
handling_action?: false,
# handling_action?: false,
supplying_demand?: false,
pads_to_snapshot: MapSet.new(),
delayed_demands: MapSet.new(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ defmodule Membrane.Core.Element.StreamFormatControllerTest do
type: :filter,
playback: :playing,
synchronization: %{clock: nil, parent_clock: nil},
handling_action?: false,
# handling_action?: false,
supplying_demand?: false,
pads_to_snapshot: MapSet.new(),
delayed_demands: MapSet.new(),
Expand Down

0 comments on commit 187b205

Please sign in to comment.