Skip to content

Commit

Permalink
Merge pull request #54 from membraneframework/jb/fix-nil-nalu-splitte…
Browse files Browse the repository at this point in the history
…r-on-eos

Prevent accessing `nil` NALu splitter/parser on end of stream
  • Loading branch information
balins committed Dec 8, 2023
2 parents 9de3f90 + 0430999 commit 5fe0648
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The package can be installed by adding `membrane_h264_plugin` to your list of de
```elixir
def deps do
[
{:membrane_h264_plugin, "~> 0.9.0"}
{:membrane_h264_plugin, "~> 0.9.1"}
]
end
```
Expand Down
3 changes: 2 additions & 1 deletion lib/membrane_h264_plugin/parser.ex
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ defmodule Membrane.H264.Parser do
end

@impl true
def handle_end_of_stream(:input, ctx, state) when state.mode != :au_aligned do
def handle_end_of_stream(:input, ctx, state)
when state.mode != :au_aligned and ctx.pads.input.start_of_stream? do
{last_nalu_payload, nalu_splitter} = NALuSplitter.split(<<>>, true, state.nalu_splitter)
{last_nalu, nalu_parser} = NALuParser.parse_nalus(last_nalu_payload, state.nalu_parser)
{maybe_improper_aus, au_splitter} = AUSplitter.split(last_nalu, true, state.au_splitter)
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
defmodule Membrane.H264.Plugin.Mixfile do
use Mix.Project

@version "0.9.0"
@github_url "https://github.com/membraneframework-labs/membrane_h264_plugin"
@version "0.9.1"
@github_url "https://github.com/membraneframework/membrane_h264_plugin"

def project do
[
Expand Down

0 comments on commit 5fe0648

Please sign in to comment.