Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop calling handle_demand after end of stream #568

Merged
merged 11 commits into from Jun 20, 2023

Conversation

FelonEkonom
Copy link
Member

@FelonEkonom FelonEkonom added the no-changelog This label has to be added if changes from the PR are not meant to be placed in the CHANGELOG.md label Jun 15, 2023
@FelonEkonom FelonEkonom marked this pull request as ready for review June 19, 2023 12:52
when action not in [:latency, :notify_parent] do
raise ActionError, action: action, reason: {:invalid_callback, :handle_init}
def handle_action(action, callback, params, state) do
state = Map.update!(state, :callback_depth_counter, &(&1 + 1))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of that, I'd set a handling_callback? flag in the callback handler

@@ -25,6 +25,9 @@ defmodule Membrane.Core.Element.ActionHandlerTest do
playback: :stopped,
synchronization: %{clock: nil, parent_clock: nil},
delayed_demands: MapSet.new(),
callback_depth_counter: 0,
pads_to_snapshot: MapSet.new(),
pads_to_snapshot: MapSet.new(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pads_to_snapshot: MapSet.new(),

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump

reraise e, __STACKTRACE__
end
end)
old_handling_action? = state.handling_action?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
old_handling_action? = state.handling_action?
was_handling_action? = state.handling_action?

@@ -25,6 +25,9 @@ defmodule Membrane.Core.Element.ActionHandlerTest do
playback: :stopped,
synchronization: %{clock: nil, parent_clock: nil},
delayed_demands: MapSet.new(),
callback_depth_counter: 0,
pads_to_snapshot: MapSet.new(),
pads_to_snapshot: MapSet.new(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump

@FelonEkonom FelonEkonom merged commit 1c31b60 into master Jun 20, 2023
7 checks passed
@FelonEkonom FelonEkonom deleted the fix-handle-demand-bug branch June 20, 2023 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog This label has to be added if changes from the PR are not meant to be placed in the CHANGELOG.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants