diff --git a/README.md b/README.md index 35365b9d..8c974458 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ The package can be installed by adding `membrane_video_compositor_plugin` to you ```elixir def deps do [ - {:membrane_video_compositor_plugin, "~> 0.5.0"} + {:membrane_video_compositor_plugin, "~> 0.5.1"} ] end ``` diff --git a/lib/membrane/video_compositor/queue/strategy/live.ex b/lib/membrane/video_compositor/queue/strategy/live.ex index d1960f60..12d9564c 100644 --- a/lib/membrane/video_compositor/queue/strategy/live.ex +++ b/lib/membrane/video_compositor/queue/strategy/live.ex @@ -110,7 +110,7 @@ defmodule Membrane.VideoCompositor.Queue.Strategy.Live do @impl true def handle_pad_removed(pad, _ctx, state) do state = - if non_eos_input_queue?(state, pad) do + if removed_without_start_of_stream?(state, pad) do Bunch.Struct.delete_in(state, [:pads_states, pad]) else state @@ -288,11 +288,14 @@ defmodule Membrane.VideoCompositor.Queue.Strategy.Live do end) end - @spec non_eos_input_queue?(State.t(), Membrane.Pad.ref()) :: boolean() - defp non_eos_input_queue?(state, pad) do - state - |> Bunch.Struct.get_in([:pads_states, pad, :events_queue]) - |> Enum.at(-1) - |> PadState.event_type() != :end_of_stream + @spec removed_without_start_of_stream?(State.t(), Membrane.Pad.ref()) :: boolean() + defp removed_without_start_of_stream?(state, pad) do + case Bunch.Struct.get_in(state, [:pads_states, pad]) do + %PadState{events_queue: events_queue} -> + events_queue |> Enum.at(-1) |> PadState.event_type() != :end_of_stream + + nil -> + false + end end end diff --git a/mix.exs b/mix.exs index 37f0030c..0c3f5b3d 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Membrane.VideoCompositor.Mixfile do use Mix.Project - @version "0.5.0" + @version "0.5.1" @github_url "https://github.com/membraneframework/membrane_video_compositor_plugin" def project do