diff --git a/lib/membrane/core/bin/pad_controller.ex b/lib/membrane/core/bin/pad_controller.ex index 0331ed77c..af6c448d7 100644 --- a/lib/membrane/core/bin/pad_controller.ex +++ b/lib/membrane/core/bin/pad_controller.ex @@ -163,33 +163,23 @@ defmodule Membrane.Core.Bin.PadController do state.pads_data |> Map.values() |> Enum.filter(&(&1.spec_ref == spec_ref)) - |> Enum.reduce( - state, - fn pad_data, state -> - if pad_data.link_id do - Membrane.Logger.debug( - "Sending link response, link_id: #{inspect(pad_data.link_id)}, pad: #{inspect(pad_data.ref)}" - ) - - Message.send(state.parent_pid, :link_response, [pad_data.link_id, pad_data.direction]) - {[], state} - else - new_state = - Membrane.Core.Child.PadModel.set_data!( - state, - pad_data.ref, - :response_received?, - true - ) + |> Enum.reduce(state, fn pad_data, state -> + if pad_data.link_id do + Membrane.Logger.debug( + "Sending link response, link_id: #{inspect(pad_data.link_id)}, pad: #{inspect(pad_data.ref)}" + ) - {[], new_state} - end - end, - fn state -> {[state], state} end, - fn _acc -> :ok end - ) - |> Enum.to_list() - |> List.first() + Message.send(state.parent_pid, :link_response, [pad_data.link_id, pad_data.direction]) + state + else + Membrane.Core.Child.PadModel.set_data!( + state, + pad_data.ref, + :response_received?, + true + ) + end + end) end @doc """ diff --git a/lib/membrane/stream_format.ex b/lib/membrane/stream_format.ex index f003f2448..8a61acf79 100644 --- a/lib/membrane/stream_format.ex +++ b/lib/membrane/stream_format.ex @@ -1,14 +1,16 @@ defmodule Membrane.StreamFormat do @moduledoc """ - Describes capabilities of some pad. + Defines the capabilities of a pad within the Membrane framework. - Every pad has some capabilities, which define a type of data that pad is - expecting. This format can be, for example, raw audio with specific sample - rate or encoded audio in given format. + Each pad in a multimedia pipeline has specific capabilities, determining the type and format + of data it can handle. For example, a pad's capabilities might include handling raw audio + with a specific sample rate or managing encoded audio in a specified format. - To link two pads together, their capabilities have to be compatible. + To successfully link two pads together, their capabilities must be compatible. """ - @typedoc @moduledoc + @typedoc """ + Represents a pad's capabilities. + """ @type t :: struct end