Skip to content

Commit

Permalink
Fix a bug with :stream_deleted message not handled in source bin. War…
Browse files Browse the repository at this point in the history
…n instead of failing if unrecogized child notification is delivered to the source bin. Bump to v0.27.2
  • Loading branch information
varsill committed Oct 31, 2024
1 parent 726f791 commit 88653cc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
14 changes: 14 additions & 0 deletions lib/membrane_rtmp_plugin/rtmp/source/source_bin.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 88653cc

Please sign in to comment.