From 88653ccd55c0326ff6d8a063fe1edaf8ed5bf308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Kita?= Date: Thu, 31 Oct 2024 16:41:29 +0100 Subject: [PATCH] Fix a bug with :stream_deleted message not handled in source bin. Warn instead of failing if unrecogized child notification is delivered to the source bin. Bump to v0.27.2 --- README.md | 2 +- lib/membrane_rtmp_plugin/rtmp/source/source_bin.ex | 14 ++++++++++++++ mix.exs | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f107805..d5eba5c 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ The package can be installed by adding `membrane_rtmp_plugin` to your list of de ```elixir def deps do [ - {:membrane_rtmp_plugin, "~> 0.27.1"} + {:membrane_rtmp_plugin, "~> 0.27.2"} ] end ``` diff --git a/lib/membrane_rtmp_plugin/rtmp/source/source_bin.ex b/lib/membrane_rtmp_plugin/rtmp/source/source_bin.ex index 49d96c2..4eba176 100644 --- a/lib/membrane_rtmp_plugin/rtmp/source/source_bin.ex +++ b/lib/membrane_rtmp_plugin/rtmp/source/source_bin.ex @@ -15,6 +15,8 @@ defmodule Membrane.RTMP.SourceBin do alias Membrane.{AAC, H264, RTMP} + require Membrane.Logger + def_output_pad :video, accepted_format: H264, availability: :on_request @@ -115,6 +117,18 @@ defmodule Membrane.RTMP.SourceBin do {[notify_parent: :unexpected_socket_close], state} end + def handle_child_notification(:stream_deleted, :src, _ctx, state) do + {[notify_parent: :stream_deleted], state} + end + + def handle_child_notification(notification, child, _ctx, state) do + Membrane.Logger.warning( + "Received unrecognized child notification from: #{inspect(child)}: #{inspect(notification)}" + ) + + {[], state} + end + @doc """ Passes the control of the socket to the `source`. diff --git a/mix.exs b/mix.exs index 065c168..d70f80d 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Membrane.RTMP.Mixfile do use Mix.Project - @version "0.27.1" + @version "0.27.2" @github_url "https://github.com/membraneframework/membrane_rtmp_plugin" def project do