From 5285e35146efd522fc988a768cdb9546d648c21a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Kita?= Date: Tue, 9 Jul 2024 15:18:47 +0200 Subject: [PATCH] Don't crash when unhandled upstream event is received (#53) --- README.md | 2 +- lib/membrane_file/source.ex | 5 +++++ mix.exs | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 37579cb..d4884a9 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ The package can be installed by adding `membrane_file_plugin` to your list of de ```elixir def deps do [ - {:membrane_file_plugin, "~> 0.17.1"} + {:membrane_file_plugin, "~> 0.17.2"} ] end ``` diff --git a/lib/membrane_file/source.ex b/lib/membrane_file/source.ex index af148d6..f22a81a 100644 --- a/lib/membrane_file/source.ex +++ b/lib/membrane_file/source.ex @@ -109,6 +109,11 @@ defmodule Membrane.File.Source do raise "Cannot handle `Membrane.File.SeekSourceEvent` in a `#{__MODULE__}` with `seekable?: false` option." end + @impl true + def handle_event(:output, _event, _ctx, state) do + {[], state} + end + @impl true def handle_demand(:output, _size, :buffers, _ctx, %{chunk_size: chunk_size} = state), do: supply_demand(chunk_size, [redemand: :output], state) diff --git a/mix.exs b/mix.exs index a639d16..de0d6f9 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Membrane.File.Plugin.Mixfile do use Mix.Project - @version "0.17.1" + @version "0.17.2" @github_url "https://github.com/membraneframework/membrane_file_plugin"