Skip to content

Commit 02831e7

Browse files
authored
Fix a bug with :stream_deleted message not handled in source bin. (#106)
* 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
1 parent 726f791 commit 02831e7

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The package can be installed by adding `membrane_rtmp_plugin` to your list of de
1414
```elixir
1515
def deps do
1616
[
17-
{:membrane_rtmp_plugin, "~> 0.27.1"}
17+
{:membrane_rtmp_plugin, "~> 0.27.2"}
1818
]
1919
end
2020
```

lib/membrane_rtmp_plugin/rtmp/source/source_bin.ex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ defmodule Membrane.RTMP.SourceBin do
1313
"""
1414
use Membrane.Bin
1515

16+
require Membrane.Logger
1617
alias Membrane.{AAC, H264, RTMP}
1718

1819
def_output_pad :video,
@@ -115,6 +116,18 @@ defmodule Membrane.RTMP.SourceBin do
115116
{[notify_parent: :unexpected_socket_close], state}
116117
end
117118

119+
def handle_child_notification(:stream_deleted, :src, _ctx, state) do
120+
{[notify_parent: :stream_deleted], state}
121+
end
122+
123+
def handle_child_notification(notification, child, _ctx, state) do
124+
Membrane.Logger.warning(
125+
"Received unrecognized child notification from: #{inspect(child)}: #{inspect(notification)}"
126+
)
127+
128+
{[], state}
129+
end
130+
118131
@doc """
119132
Passes the control of the socket to the `source`.
120133

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Membrane.RTMP.Mixfile do
22
use Mix.Project
33

4-
@version "0.27.1"
4+
@version "0.27.2"
55
@github_url "https://github.com/membraneframework/membrane_rtmp_plugin"
66

77
def project do

0 commit comments

Comments
 (0)