Skip to content

Commit

Permalink
Merge pull request #59 from membraneframework/stream_format_flush_fix
Browse files Browse the repository at this point in the history
Handle Stream Format flush fix
  • Loading branch information
bartkrak authored May 15, 2024
2 parents 0e5d5d2 + d8beef2 commit 8219586
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ It is a part of [Membrane Multimedia Framework](https://membrane.stream).
Add the following line to your `deps` in `mix.exs`. Run `mix deps.get`.

```elixir
{:membrane_ffmpeg_swresample_plugin, "~> 0.20.1"}
{:membrane_ffmpeg_swresample_plugin, "~> 0.20.2"}
```

The precompiled builds of the [ffmpeg](https://www.ffmpeg.org) will be pulled and linked automatically. However, should there be any problems, consider installing it manually.
Expand Down
20 changes: 12 additions & 8 deletions lib/membrane_ffmpeg_swresample_plugin/converter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,18 @@ defmodule Membrane.FFmpeg.SWResample.Converter do
check_dropped_frames(state)

flushed_actions =
case flush!(state.native) do
<<>> ->
[]

converted ->
output_duration = calculate_output_duration(converted, state)
{_state, out_pts} = update_pts_queue(state, output_duration, true)
[buffer: {:output, %Buffer{payload: converted, pts: out_pts}}]
if state.native == nil do
[]
else
case flush!(state.native) do
<<>> ->
[]

converted ->
output_duration = calculate_output_duration(converted, state)
{_state, out_pts} = update_pts_queue(state, output_duration, true)
[buffer: {:output, %Buffer{payload: converted, pts: out_pts}}]
end
end

# create new converter
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule Membrane.FFmpeg.SWResample.Mixfile do
use Mix.Project

@github_url "https://github.com/membraneframework/membrane_ffmpeg_swresample_plugin"
@version "0.20.1"
@version "0.20.2"

def project do
[
Expand Down

0 comments on commit 8219586

Please sign in to comment.